diff --git a/Monitoring/metadata/V3/Alert.php b/Monitoring/metadata/V3/Alert.php index cb97c4e4902..e681f2e916e 100644 Binary files a/Monitoring/metadata/V3/Alert.php and b/Monitoring/metadata/V3/Alert.php differ diff --git a/Monitoring/metadata/V3/AlertService.php b/Monitoring/metadata/V3/AlertService.php index a60b5c01e82..b5ca2fc73a9 100644 --- a/Monitoring/metadata/V3/AlertService.php +++ b/Monitoring/metadata/V3/AlertService.php @@ -21,84 +21,42 @@ public static function initOnce() { \GPBMetadata\Google\Monitoring\V3\Alert::initOnce(); \GPBMetadata\Google\Protobuf\GPBEmpty::initOnce(); \GPBMetadata\Google\Protobuf\FieldMask::initOnce(); - $pool->internalAddGeneratedFile(hex2bin( - "0ad2110a28676f6f676c652f6d6f6e69746f72696e672f76332f616c6572" . - "745f736572766963652e70726f746f1214676f6f676c652e6d6f6e69746f" . - "72696e672e76331a17676f6f676c652f6170692f636c69656e742e70726f" . - "746f1a1f676f6f676c652f6170692f6669656c645f6265686176696f722e" . - "70726f746f1a19676f6f676c652f6170692f7265736f757263652e70726f" . - "746f1a20676f6f676c652f6d6f6e69746f72696e672f76332f616c657274" . - "2e70726f746f1a1b676f6f676c652f70726f746f6275662f656d7074792e" . - "70726f746f1a20676f6f676c652f70726f746f6275662f6669656c645f6d" . - "61736b2e70726f746f2295010a18437265617465416c657274506f6c6963" . - "7952657175657374123b0a046e616d65180320012809422de04102fa4127" . - "12256d6f6e69746f72696e672e676f6f676c65617069732e636f6d2f416c" . - "657274506f6c696379123c0a0c616c6572745f706f6c6963791802200128" . - "0b32212e676f6f676c652e6d6f6e69746f72696e672e76332e416c657274" . - "506f6c6963794203e0410222540a15476574416c657274506f6c69637952" . - "657175657374123b0a046e616d65180320012809422de04102fa41270a25" . - "6d6f6e69746f72696e672e676f6f676c65617069732e636f6d2f416c6572" . - "74506f6c69637922a0010a184c697374416c657274506f6c696369657352" . - "657175657374123b0a046e616d65180420012809422de04102fa41271225" . - "6d6f6e69746f72696e672e676f6f676c65617069732e636f6d2f416c6572" . - "74506f6c696379120e0a0666696c74657218052001280912100a086f7264" . - "65725f627918062001280912110a09706167655f73697a65180220012805" . - "12120a0a706167655f746f6b656e180320012809226f0a194c697374416c" . - "657274506f6c6963696573526573706f6e736512390a0e616c6572745f70" . - "6f6c696369657318032003280b32212e676f6f676c652e6d6f6e69746f72" . - "696e672e76332e416c657274506f6c69637912170a0f6e6578745f706167" . - "655f746f6b656e1802200128092289010a18557064617465416c65727450" . - "6f6c69637952657175657374122f0a0b7570646174655f6d61736b180220" . - "01280b321a2e676f6f676c652e70726f746f6275662e4669656c644d6173" . - "6b123c0a0c616c6572745f706f6c69637918032001280b32212e676f6f67" . - "6c652e6d6f6e69746f72696e672e76332e416c657274506f6c6963794203" . - "e0410222570a1844656c657465416c657274506f6c696379526571756573" . - "74123b0a046e616d65180320012809422de04102fa41270a256d6f6e6974" . - "6f72696e672e676f6f676c65617069732e636f6d2f416c657274506f6c69" . - "6379329e080a12416c657274506f6c6963795365727669636512a8010a11" . - "4c697374416c657274506f6c6963696573122e2e676f6f676c652e6d6f6e" . - "69746f72696e672e76332e4c697374416c657274506f6c69636965735265" . - "71756573741a2f2e676f6f676c652e6d6f6e69746f72696e672e76332e4c" . - "697374416c657274506f6c6963696573526573706f6e7365223282d3e493" . - "022512232f76332f7b6e616d653d70726f6a656374732f2a7d2f616c6572" . - "74506f6c6963696573da41046e616d651296010a0e476574416c65727450" . - "6f6c696379122b2e676f6f676c652e6d6f6e69746f72696e672e76332e47" . - "6574416c657274506f6c696379526571756573741a212e676f6f676c652e" . - "6d6f6e69746f72696e672e76332e416c657274506f6c696379223482d3e4" . - "93022712252f76332f7b6e616d653d70726f6a656374732f2a2f616c6572" . - "74506f6c69636965732f2a7dda41046e616d6512b5010a11437265617465" . - "416c657274506f6c696379122e2e676f6f676c652e6d6f6e69746f72696e" . - "672e76332e437265617465416c657274506f6c696379526571756573741a" . - "212e676f6f676c652e6d6f6e69746f72696e672e76332e416c657274506f" . - "6c696379224d82d3e493023322232f76332f7b6e616d653d70726f6a6563" . - "74732f2a7d2f616c657274506f6c69636965733a0c616c6572745f706f6c" . - "696379da41116e616d652c616c6572745f706f6c6963791291010a114465" . - "6c657465416c657274506f6c696379122e2e676f6f676c652e6d6f6e6974" . - "6f72696e672e76332e44656c657465416c657274506f6c69637952657175" . - "6573741a162e676f6f676c652e70726f746f6275662e456d707479223482" . - "d3e49302272a252f76332f7b6e616d653d70726f6a656374732f2a2f616c" . - "657274506f6c69636965732f2a7dda41046e616d6512cb010a1155706461" . - "7465416c657274506f6c696379122e2e676f6f676c652e6d6f6e69746f72" . - "696e672e76332e557064617465416c657274506f6c696379526571756573" . - "741a212e676f6f676c652e6d6f6e69746f72696e672e76332e416c657274" . - "506f6c696379226382d3e493024232322f76332f7b616c6572745f706f6c" . - "6963792e6e616d653d70726f6a656374732f2a2f616c657274506f6c6963" . - "6965732f2a7d3a0c616c6572745f706f6c696379da41187570646174655f" . - "6d61736b2c616c6572745f706f6c6963791aa901ca41196d6f6e69746f72" . - "696e672e676f6f676c65617069732e636f6dd241890168747470733a2f2f" . - "7777772e676f6f676c65617069732e636f6d2f617574682f636c6f75642d" . - "706c6174666f726d2c68747470733a2f2f7777772e676f6f676c65617069" . - "732e636f6d2f617574682f6d6f6e69746f72696e672c68747470733a2f2f" . - "7777772e676f6f676c65617069732e636f6d2f617574682f6d6f6e69746f" . - "72696e672e7265616442c9010a18636f6d2e676f6f676c652e6d6f6e6974" . - "6f72696e672e76334211416c6572745365727669636550726f746f50015a" . - "3e676f6f676c652e676f6c616e672e6f72672f67656e70726f746f2f676f" . - "6f676c65617069732f6d6f6e69746f72696e672f76333b6d6f6e69746f72" . - "696e67aa021a476f6f676c652e436c6f75642e4d6f6e69746f72696e672e" . - "5633ca021a476f6f676c655c436c6f75645c4d6f6e69746f72696e675c56" . - "33ea021d476f6f676c653a3a436c6f75643a3a4d6f6e69746f72696e673a" . - "3a5633620670726f746f33" - ), true); + $pool->internalAddGeneratedFile( + ' +ç +(google/monitoring/v3/alert_service.protogoogle.monitoring.v3google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto google/monitoring/v3/alert.protogoogle/protobuf/empty.proto google/protobuf/field_mask.proto"• +CreateAlertPolicyRequest; +name ( B-àAúA\'%monitoring.googleapis.com/AlertPolicy< + alert_policy ( 2!.google.monitoring.v3.AlertPolicyBàA"T +GetAlertPolicyRequest; +name ( B-àAúA\' +%monitoring.googleapis.com/AlertPolicy"  +ListAlertPoliciesRequest; +name ( B-àAúA\'%monitoring.googleapis.com/AlertPolicy +filter (  +order_by (  + page_size ( + +page_token ( "ƒ +ListAlertPoliciesResponse9 +alert_policies ( 2!.google.monitoring.v3.AlertPolicy +next_page_token (  + +total_size ("‰ +UpdateAlertPolicyRequest/ + update_mask ( 2.google.protobuf.FieldMask< + alert_policy ( 2!.google.monitoring.v3.AlertPolicyBàA"W +DeleteAlertPolicyRequest; +name ( B-àAúA\' +%monitoring.googleapis.com/AlertPolicy2ž +AlertPolicyService¨ +ListAlertPolicies..google.monitoring.v3.ListAlertPoliciesRequest/.google.monitoring.v3.ListAlertPoliciesResponse"2‚Óä“%#/v3/{name=projects/*}/alertPoliciesÚAname– +GetAlertPolicy+.google.monitoring.v3.GetAlertPolicyRequest!.google.monitoring.v3.AlertPolicy"4‚Óä“\'%/v3/{name=projects/*/alertPolicies/*}ÚAnameµ +CreateAlertPolicy..google.monitoring.v3.CreateAlertPolicyRequest!.google.monitoring.v3.AlertPolicy"M‚Óä“3"#/v3/{name=projects/*}/alertPolicies: alert_policyÚAname,alert_policy‘ +DeleteAlertPolicy..google.monitoring.v3.DeleteAlertPolicyRequest.google.protobuf.Empty"4‚Óä“\'*%/v3/{name=projects/*/alertPolicies/*}ÚAnameË +UpdateAlertPolicy..google.monitoring.v3.UpdateAlertPolicyRequest!.google.monitoring.v3.AlertPolicy"c‚Óä“B22/v3/{alert_policy.name=projects/*/alertPolicies/*}: alert_policyÚAupdate_mask,alert_policy©ÊAmonitoring.googleapis.comÒA‰https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/monitoring,https://www.googleapis.com/auth/monitoring.readBÉ +com.google.monitoring.v3BAlertServiceProtoPZ>google.golang.org/genproto/googleapis/monitoring/v3;monitoringªGoogle.Cloud.Monitoring.V3ÊGoogle\\Cloud\\Monitoring\\V3êGoogle::Cloud::Monitoring::V3bproto3' + , true); static::$is_initialized = true; } diff --git a/Monitoring/metadata/V3/Common.php b/Monitoring/metadata/V3/Common.php index 8417f981284..57253ec061b 100644 Binary files a/Monitoring/metadata/V3/Common.php and b/Monitoring/metadata/V3/Common.php differ diff --git a/Monitoring/metadata/V3/DroppedLabels.php b/Monitoring/metadata/V3/DroppedLabels.php index b0275f95156..7e7a042ea75 100644 --- a/Monitoring/metadata/V3/DroppedLabels.php +++ b/Monitoring/metadata/V3/DroppedLabels.php @@ -14,22 +14,18 @@ public static function initOnce() { if (static::$is_initialized == true) { return; } - $pool->internalAddGeneratedFile(hex2bin( - "0a94030a29676f6f676c652f6d6f6e69746f72696e672f76332f64726f70" . - "7065645f6c6162656c732e70726f746f1214676f6f676c652e6d6f6e6974" . - "6f72696e672e7633227c0a0d44726f707065644c6162656c73123d0a056c" . - "6162656c18012003280b322e2e676f6f676c652e6d6f6e69746f72696e67" . - "2e76332e44726f707065644c6162656c732e4c6162656c456e7472791a2c" . - "0a0a4c6162656c456e747279120b0a036b6579180120012809120d0a0576" . - "616c75651802200128093a02380142ca010a18636f6d2e676f6f676c652e" . - "6d6f6e69746f72696e672e7633421244726f707065644c6162656c735072" . - "6f746f50015a3e676f6f676c652e676f6c616e672e6f72672f67656e7072" . - "6f746f2f676f6f676c65617069732f6d6f6e69746f72696e672f76333b6d" . - "6f6e69746f72696e67aa021a476f6f676c652e436c6f75642e4d6f6e6974" . - "6f72696e672e5633ca021a476f6f676c655c436c6f75645c4d6f6e69746f" . - "72696e675c5633ea021d476f6f676c653a3a436c6f75643a3a4d6f6e6974" . - "6f72696e673a3a5633620670726f746f33" - ), true); + $pool->internalAddGeneratedFile( + ' +” +)google/monitoring/v3/dropped_labels.protogoogle.monitoring.v3"| + DroppedLabels= +label ( 2..google.monitoring.v3.DroppedLabels.LabelEntry, + +LabelEntry +key (  +value ( :8BÊ +com.google.monitoring.v3BDroppedLabelsProtoPZ>google.golang.org/genproto/googleapis/monitoring/v3;monitoringªGoogle.Cloud.Monitoring.V3ÊGoogle\\Cloud\\Monitoring\\V3êGoogle::Cloud::Monitoring::V3bproto3' + , true); static::$is_initialized = true; } diff --git a/Monitoring/metadata/V3/Group.php b/Monitoring/metadata/V3/Group.php index 4c476a3ecd3..e3e95437843 100644 --- a/Monitoring/metadata/V3/Group.php +++ b/Monitoring/metadata/V3/Group.php @@ -15,26 +15,21 @@ public static function initOnce() { return; } \GPBMetadata\Google\Api\Resource::initOnce(); - $pool->internalAddGeneratedFile(hex2bin( - "0a88040a20676f6f676c652f6d6f6e69746f72696e672f76332f67726f75" . - "702e70726f746f1214676f6f676c652e6d6f6e69746f72696e672e763322" . - "80020a0547726f7570120c0a046e616d6518012001280912140a0c646973" . - "706c61795f6e616d6518022001280912130a0b706172656e745f6e616d65" . - "180320012809120e0a0666696c74657218052001280912120a0a69735f63" . - "6c75737465721806200128083a9901ea4195010a1f6d6f6e69746f72696e" . - "672e676f6f676c65617069732e636f6d2f47726f7570122170726f6a6563" . - "74732f7b70726f6a6563747d2f67726f7570732f7b67726f75707d122b6f" . - "7267616e697a6174696f6e732f7b6f7267616e697a6174696f6e7d2f6772" . - "6f7570732f7b67726f75707d121f666f6c646572732f7b666f6c6465727d" . - "2f67726f7570732f7b67726f75707d12012a42c2010a18636f6d2e676f6f" . - "676c652e6d6f6e69746f72696e672e7633420a47726f757050726f746f50" . - "015a3e676f6f676c652e676f6c616e672e6f72672f67656e70726f746f2f" . - "676f6f676c65617069732f6d6f6e69746f72696e672f76333b6d6f6e6974" . - "6f72696e67aa021a476f6f676c652e436c6f75642e4d6f6e69746f72696e" . - "672e5633ca021a476f6f676c655c436c6f75645c4d6f6e69746f72696e67" . - "5c5633ea021d476f6f676c653a3a436c6f75643a3a4d6f6e69746f72696e" . - "673a3a5633620670726f746f33" - ), true); + $pool->internalAddGeneratedFile( + ' +ˆ + google/monitoring/v3/group.protogoogle.monitoring.v3"€ +Group +name (  + display_name (  + parent_name (  +filter (  + +is_cluster (:™êA• +monitoring.googleapis.com/Group!projects/{project}/groups/{group}+organizations/{organization}/groups/{group}folders/{folder}/groups/{group}*B +com.google.monitoring.v3B +GroupProtoPZ>google.golang.org/genproto/googleapis/monitoring/v3;monitoringªGoogle.Cloud.Monitoring.V3ÊGoogle\\Cloud\\Monitoring\\V3êGoogle::Cloud::Monitoring::V3bproto3' + , true); static::$is_initialized = true; } diff --git a/Monitoring/metadata/V3/GroupService.php b/Monitoring/metadata/V3/GroupService.php index c3cae380f95..d1d73f8f1d7 100644 Binary files a/Monitoring/metadata/V3/GroupService.php and b/Monitoring/metadata/V3/GroupService.php differ diff --git a/Monitoring/metadata/V3/Metric.php b/Monitoring/metadata/V3/Metric.php index ce16d6d102d..af2fd6043ed 100644 Binary files a/Monitoring/metadata/V3/Metric.php and b/Monitoring/metadata/V3/Metric.php differ diff --git a/Monitoring/metadata/V3/MetricService.php b/Monitoring/metadata/V3/MetricService.php index 0efd3ea9324..ba32291f711 100644 Binary files a/Monitoring/metadata/V3/MetricService.php and b/Monitoring/metadata/V3/MetricService.php differ diff --git a/Monitoring/metadata/V3/MutationRecord.php b/Monitoring/metadata/V3/MutationRecord.php index 9d6416ce7ef..605c2f19932 100644 --- a/Monitoring/metadata/V3/MutationRecord.php +++ b/Monitoring/metadata/V3/MutationRecord.php @@ -15,21 +15,16 @@ public static function initOnce() { return; } \GPBMetadata\Google\Protobuf\Timestamp::initOnce(); - $pool->internalAddGeneratedFile(hex2bin( - "0aef020a2a676f6f676c652f6d6f6e69746f72696e672f76332f6d757461" . - "74696f6e5f7265636f72642e70726f746f1214676f6f676c652e6d6f6e69" . - "746f72696e672e763322550a0e4d75746174696f6e5265636f7264122f0a" . - "0b6d75746174655f74696d6518012001280b321a2e676f6f676c652e7072" . - "6f746f6275662e54696d657374616d7012120a0a6d7574617465645f6279" . - "18022001280942cb010a18636f6d2e676f6f676c652e6d6f6e69746f7269" . - "6e672e763342134d75746174696f6e5265636f726450726f746f50015a3e" . - "676f6f676c652e676f6c616e672e6f72672f67656e70726f746f2f676f6f" . - "676c65617069732f6d6f6e69746f72696e672f76333b6d6f6e69746f7269" . - "6e67aa021a476f6f676c652e436c6f75642e4d6f6e69746f72696e672e56" . - "33ca021a476f6f676c655c436c6f75645c4d6f6e69746f72696e675c5633" . - "ea021d476f6f676c653a3a436c6f75643a3a4d6f6e69746f72696e673a3a" . - "5633620670726f746f33" - ), true); + $pool->internalAddGeneratedFile( + ' +ï +*google/monitoring/v3/mutation_record.protogoogle.monitoring.v3"U +MutationRecord/ + mutate_time ( 2.google.protobuf.Timestamp + +mutated_by ( BË +com.google.monitoring.v3BMutationRecordProtoPZ>google.golang.org/genproto/googleapis/monitoring/v3;monitoringªGoogle.Cloud.Monitoring.V3ÊGoogle\\Cloud\\Monitoring\\V3êGoogle::Cloud::Monitoring::V3bproto3' + , true); static::$is_initialized = true; } diff --git a/Monitoring/metadata/V3/Notification.php b/Monitoring/metadata/V3/Notification.php index 32754cc94ea..dc1082ca1ed 100644 Binary files a/Monitoring/metadata/V3/Notification.php and b/Monitoring/metadata/V3/Notification.php differ diff --git a/Monitoring/metadata/V3/NotificationService.php b/Monitoring/metadata/V3/NotificationService.php index 58ec5f3713f..c99cbe7ef68 100644 --- a/Monitoring/metadata/V3/NotificationService.php +++ b/Monitoring/metadata/V3/NotificationService.php @@ -23,169 +23,74 @@ public static function initOnce() { \GPBMetadata\Google\Protobuf\FieldMask::initOnce(); \GPBMetadata\Google\Protobuf\Struct::initOnce(); \GPBMetadata\Google\Protobuf\Timestamp::initOnce(); - $pool->internalAddGeneratedFile(hex2bin( - "0ac3250a2f676f6f676c652f6d6f6e69746f72696e672f76332f6e6f7469" . - "6669636174696f6e5f736572766963652e70726f746f1214676f6f676c65" . - "2e6d6f6e69746f72696e672e76331a17676f6f676c652f6170692f636c69" . - "656e742e70726f746f1a1f676f6f676c652f6170692f6669656c645f6265" . - "686176696f722e70726f746f1a19676f6f676c652f6170692f7265736f75" . - "7263652e70726f746f1a27676f6f676c652f6d6f6e69746f72696e672f76" . - "332f6e6f74696669636174696f6e2e70726f746f1a1b676f6f676c652f70" . - "726f746f6275662f656d7074792e70726f746f1a20676f6f676c652f7072" . - "6f746f6275662f6669656c645f6d61736b2e70726f746f1a1c676f6f676c" . - "652f70726f746f6275662f7374727563742e70726f746f1a1f676f6f676c" . - "652f70726f746f6275662f74696d657374616d702e70726f746f22a1010a" . - "294c6973744e6f74696669636174696f6e4368616e6e656c446573637269" . - "70746f727352657175657374124d0a046e616d65180420012809423fe041" . - "02fa413912376d6f6e69746f72696e672e676f6f676c65617069732e636f" . - "6d2f4e6f74696669636174696f6e4368616e6e656c44657363726970746f" . - "7212110a09706167655f73697a6518022001280512120a0a706167655f74" . - "6f6b656e1803200128092297010a2a4c6973744e6f74696669636174696f" . - "6e4368616e6e656c44657363726970746f7273526573706f6e736512500a" . - "136368616e6e656c5f64657363726970746f727318012003280b32332e67" . - "6f6f676c652e6d6f6e69746f72696e672e76332e4e6f7469666963617469" . - "6f6e4368616e6e656c44657363726970746f7212170a0f6e6578745f7061" . - "67655f746f6b656e18022001280922780a274765744e6f74696669636174" . - "696f6e4368616e6e656c44657363726970746f7252657175657374124d0a" . - "046e616d65180320012809423fe04102fa41390a376d6f6e69746f72696e" . - "672e676f6f676c65617069732e636f6d2f4e6f74696669636174696f6e43" . - "68616e6e656c44657363726970746f7222b5010a204372656174654e6f74" . - "696669636174696f6e4368616e6e656c5265717565737412430a046e616d" . - "651803200128094235e04102fa412f122d6d6f6e69746f72696e672e676f" . - "6f676c65617069732e636f6d2f4e6f74696669636174696f6e4368616e6e" . - "656c124c0a146e6f74696669636174696f6e5f6368616e6e656c18022001" . - "280b32292e676f6f676c652e6d6f6e69746f72696e672e76332e4e6f7469" . - "6669636174696f6e4368616e6e656c4203e0410222af010a1f4c6973744e" . - "6f74696669636174696f6e4368616e6e656c735265717565737412430a04" . - "6e616d651805200128094235e04102fa412f122d6d6f6e69746f72696e67" . - "2e676f6f676c65617069732e636f6d2f4e6f74696669636174696f6e4368" . - "616e6e656c120e0a0666696c74657218062001280912100a086f72646572" . - "5f627918072001280912110a09706167655f73697a651803200128051212" . - "0a0a706167655f746f6b656e1804200128092285010a204c6973744e6f74" . - "696669636174696f6e4368616e6e656c73526573706f6e736512480a156e" . - "6f74696669636174696f6e5f6368616e6e656c7318032003280b32292e67" . - "6f6f676c652e6d6f6e69746f72696e672e76332e4e6f7469666963617469" . - "6f6e4368616e6e656c12170a0f6e6578745f706167655f746f6b656e1802" . - "2001280922640a1d4765744e6f74696669636174696f6e4368616e6e656c" . - "5265717565737412430a046e616d651803200128094235e04102fa412f0a" . - "2d6d6f6e69746f72696e672e676f6f676c65617069732e636f6d2f4e6f74" . - "696669636174696f6e4368616e6e656c22a1010a205570646174654e6f74" . - "696669636174696f6e4368616e6e656c52657175657374122f0a0b757064" . - "6174655f6d61736b18022001280b321a2e676f6f676c652e70726f746f62" . - "75662e4669656c644d61736b124c0a146e6f74696669636174696f6e5f63" . - "68616e6e656c18032001280b32292e676f6f676c652e6d6f6e69746f7269" . - "6e672e76332e4e6f74696669636174696f6e4368616e6e656c4203e04102" . - "22760a2044656c6574654e6f74696669636174696f6e4368616e6e656c52" . - "65717565737412430a046e616d651803200128094235e04102fa412f0a2d" . - "6d6f6e69746f72696e672e676f6f676c65617069732e636f6d2f4e6f7469" . - "6669636174696f6e4368616e6e656c120d0a05666f726365180520012808" . - "22750a2e53656e644e6f74696669636174696f6e4368616e6e656c566572" . - "696669636174696f6e436f64655265717565737412430a046e616d651801" . - "200128094235e04102fa412f0a2d6d6f6e69746f72696e672e676f6f676c" . - "65617069732e636f6d2f4e6f74696669636174696f6e4368616e6e656c22" . - "a5010a2d4765744e6f74696669636174696f6e4368616e6e656c56657269" . - "6669636174696f6e436f64655265717565737412430a046e616d65180120" . - "0128094235e04102fa412f0a2d6d6f6e69746f72696e672e676f6f676c65" . - "617069732e636f6d2f4e6f74696669636174696f6e4368616e6e656c122f" . - "0a0b6578706972655f74696d6518022001280b321a2e676f6f676c652e70" . - "726f746f6275662e54696d657374616d70226f0a2e4765744e6f74696669" . - "636174696f6e4368616e6e656c566572696669636174696f6e436f646552" . - "6573706f6e7365120c0a04636f6465180120012809122f0a0b6578706972" . - "655f74696d6518022001280b321a2e676f6f676c652e70726f746f627566" . - "2e54696d657374616d70227a0a205665726966794e6f7469666963617469" . - "6f6e4368616e6e656c5265717565737412430a046e616d65180120012809" . - "4235e04102fa412f0a2d6d6f6e69746f72696e672e676f6f676c65617069" . - "732e636f6d2f4e6f74696669636174696f6e4368616e6e656c12110a0463" . - "6f64651802200128094203e0410232ea120a1a4e6f74696669636174696f" . - "6e4368616e6e656c5365727669636512ec010a224c6973744e6f74696669" . - "636174696f6e4368616e6e656c44657363726970746f7273123f2e676f6f" . - "676c652e6d6f6e69746f72696e672e76332e4c6973744e6f746966696361" . - "74696f6e4368616e6e656c44657363726970746f7273526571756573741a" . - "402e676f6f676c652e6d6f6e69746f72696e672e76332e4c6973744e6f74" . - "696669636174696f6e4368616e6e656c44657363726970746f7273526573" . - "706f6e7365224382d3e493023612342f76332f7b6e616d653d70726f6a65" . - "6374732f2a7d2f6e6f74696669636174696f6e4368616e6e656c44657363" . - "726970746f7273da41046e616d6512dd010a204765744e6f746966696361" . - "74696f6e4368616e6e656c44657363726970746f72123d2e676f6f676c65" . - "2e6d6f6e69746f72696e672e76332e4765744e6f74696669636174696f6e" . - "4368616e6e656c44657363726970746f72526571756573741a332e676f6f" . - "676c652e6d6f6e69746f72696e672e76332e4e6f74696669636174696f6e" . - "4368616e6e656c44657363726970746f72224582d3e493023812362f7633" . - "2f7b6e616d653d70726f6a656374732f2a2f6e6f74696669636174696f6e" . - "4368616e6e656c44657363726970746f72732f2a7dda41046e616d6512c4" . - "010a184c6973744e6f74696669636174696f6e4368616e6e656c7312352e" . - "676f6f676c652e6d6f6e69746f72696e672e76332e4c6973744e6f746966" . - "69636174696f6e4368616e6e656c73526571756573741a362e676f6f676c" . - "652e6d6f6e69746f72696e672e76332e4c6973744e6f7469666963617469" . - "6f6e4368616e6e656c73526573706f6e7365223982d3e493022c122a2f76" . - "332f7b6e616d653d70726f6a656374732f2a7d2f6e6f7469666963617469" . - "6f6e4368616e6e656c73da41046e616d6512b5010a164765744e6f746966" . - "69636174696f6e4368616e6e656c12332e676f6f676c652e6d6f6e69746f" . - "72696e672e76332e4765744e6f74696669636174696f6e4368616e6e656c" . - "526571756573741a292e676f6f676c652e6d6f6e69746f72696e672e7633" . - "2e4e6f74696669636174696f6e4368616e6e656c223b82d3e493022e122c" . - "2f76332f7b6e616d653d70726f6a656374732f2a2f6e6f74696669636174" . - "696f6e4368616e6e656c732f2a7dda41046e616d6512e4010a1943726561" . - "74654e6f74696669636174696f6e4368616e6e656c12362e676f6f676c65" . - "2e6d6f6e69746f72696e672e76332e4372656174654e6f74696669636174" . - "696f6e4368616e6e656c526571756573741a292e676f6f676c652e6d6f6e" . - "69746f72696e672e76332e4e6f74696669636174696f6e4368616e6e656c" . - "226482d3e4930242222a2f76332f7b6e616d653d70726f6a656374732f2a" . - "7d2f6e6f74696669636174696f6e4368616e6e656c733a146e6f74696669" . - "636174696f6e5f6368616e6e656cda41196e616d652c6e6f746966696361" . - "74696f6e5f6368616e6e656c1283020a195570646174654e6f7469666963" . - "6174696f6e4368616e6e656c12362e676f6f676c652e6d6f6e69746f7269" . - "6e672e76332e5570646174654e6f74696669636174696f6e4368616e6e65" . - "6c526571756573741a292e676f6f676c652e6d6f6e69746f72696e672e76" . - "332e4e6f74696669636174696f6e4368616e6e656c22820182d3e4930259" . - "32412f76332f7b6e6f74696669636174696f6e5f6368616e6e656c2e6e61" . - "6d653d70726f6a656374732f2a2f6e6f74696669636174696f6e4368616e" . - "6e656c732f2a7d3a146e6f74696669636174696f6e5f6368616e6e656cda" . - "41207570646174655f6d61736b2c6e6f74696669636174696f6e5f636861" . - "6e6e656c12ae010a1944656c6574654e6f74696669636174696f6e436861" . - "6e6e656c12362e676f6f676c652e6d6f6e69746f72696e672e76332e4465" . - "6c6574654e6f74696669636174696f6e4368616e6e656c52657175657374" . - "1a162e676f6f676c652e70726f746f6275662e456d707479224182d3e493" . - "022e2a2c2f76332f7b6e616d653d70726f6a656374732f2a2f6e6f746966" . - "69636174696f6e4368616e6e656c732f2a7dda410a6e616d652c666f7263" . - "6512dc010a2753656e644e6f74696669636174696f6e4368616e6e656c56" . - "6572696669636174696f6e436f646512442e676f6f676c652e6d6f6e6974" . - "6f72696e672e76332e53656e644e6f74696669636174696f6e4368616e6e" . - "656c566572696669636174696f6e436f6465526571756573741a162e676f" . - "6f676c652e70726f746f6275662e456d707479225382d3e493024622412f" . - "76332f7b6e616d653d70726f6a656374732f2a2f6e6f7469666963617469" . - "6f6e4368616e6e656c732f2a7d3a73656e64566572696669636174696f6e" . - "436f64653a012ada41046e616d651287020a264765744e6f746966696361" . - "74696f6e4368616e6e656c566572696669636174696f6e436f646512432e" . - "676f6f676c652e6d6f6e69746f72696e672e76332e4765744e6f74696669" . - "636174696f6e4368616e6e656c566572696669636174696f6e436f646552" . - "6571756573741a442e676f6f676c652e6d6f6e69746f72696e672e76332e" . - "4765744e6f74696669636174696f6e4368616e6e656c5665726966696361" . - "74696f6e436f6465526573706f6e7365225282d3e493024522402f76332f" . - "7b6e616d653d70726f6a656374732f2a2f6e6f74696669636174696f6e43" . - "68616e6e656c732f2a7d3a676574566572696669636174696f6e436f6465" . - "3a012ada41046e616d6512ca010a195665726966794e6f74696669636174" . - "696f6e4368616e6e656c12362e676f6f676c652e6d6f6e69746f72696e67" . - "2e76332e5665726966794e6f74696669636174696f6e4368616e6e656c52" . - "6571756573741a292e676f6f676c652e6d6f6e69746f72696e672e76332e" . - "4e6f74696669636174696f6e4368616e6e656c224a82d3e493023822332f" . - "76332f7b6e616d653d70726f6a656374732f2a2f6e6f7469666963617469" . - "6f6e4368616e6e656c732f2a7d3a7665726966793a012ada41096e616d65" . - "2c636f64651aa901ca41196d6f6e69746f72696e672e676f6f676c656170" . - "69732e636f6dd241890168747470733a2f2f7777772e676f6f676c656170" . - "69732e636f6d2f617574682f636c6f75642d706c6174666f726d2c687474" . - "70733a2f2f7777772e676f6f676c65617069732e636f6d2f617574682f6d" . - "6f6e69746f72696e672c68747470733a2f2f7777772e676f6f676c656170" . - "69732e636f6d2f617574682f6d6f6e69746f72696e672e7265616442d001" . - "0a18636f6d2e676f6f676c652e6d6f6e69746f72696e672e763342184e6f" . - "74696669636174696f6e5365727669636550726f746f50015a3e676f6f67" . - "6c652e676f6c616e672e6f72672f67656e70726f746f2f676f6f676c6561" . - "7069732f6d6f6e69746f72696e672f76333b6d6f6e69746f72696e67aa02" . - "1a476f6f676c652e436c6f75642e4d6f6e69746f72696e672e5633ca021a" . - "476f6f676c655c436c6f75645c4d6f6e69746f72696e675c5633ea021d47" . - "6f6f676c653a3a436c6f75643a3a4d6f6e69746f72696e673a3a56336206" . - "70726f746f33" - ), true); + $pool->internalAddGeneratedFile( + ' +×% +/google/monitoring/v3/notification_service.protogoogle.monitoring.v3google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto\'google/monitoring/v3/notification.protogoogle/protobuf/empty.proto google/protobuf/field_mask.protogoogle/protobuf/struct.protogoogle/protobuf/timestamp.proto"¡ +)ListNotificationChannelDescriptorsRequestM +name ( B?àAúA97monitoring.googleapis.com/NotificationChannelDescriptor + page_size ( + +page_token ( "— +*ListNotificationChannelDescriptorsResponseP +channel_descriptors ( 23.google.monitoring.v3.NotificationChannelDescriptor +next_page_token ( "x +\'GetNotificationChannelDescriptorRequestM +name ( B?àAúA9 +7monitoring.googleapis.com/NotificationChannelDescriptor"µ + CreateNotificationChannelRequestC +name ( B5àAúA/-monitoring.googleapis.com/NotificationChannelL +notification_channel ( 2).google.monitoring.v3.NotificationChannelBàA"¯ +ListNotificationChannelsRequestC +name ( B5àAúA/-monitoring.googleapis.com/NotificationChannel +filter (  +order_by (  + page_size ( + +page_token ( "™ + ListNotificationChannelsResponseH +notification_channels ( 2).google.monitoring.v3.NotificationChannel +next_page_token (  + +total_size ("d +GetNotificationChannelRequestC +name ( B5àAúA/ +-monitoring.googleapis.com/NotificationChannel"¡ + UpdateNotificationChannelRequest/ + update_mask ( 2.google.protobuf.FieldMaskL +notification_channel ( 2).google.monitoring.v3.NotificationChannelBàA"v + DeleteNotificationChannelRequestC +name ( B5àAúA/ +-monitoring.googleapis.com/NotificationChannel +force ("u +.SendNotificationChannelVerificationCodeRequestC +name ( B5àAúA/ +-monitoring.googleapis.com/NotificationChannel"¥ +-GetNotificationChannelVerificationCodeRequestC +name ( B5àAúA/ +-monitoring.googleapis.com/NotificationChannel/ + expire_time ( 2.google.protobuf.Timestamp"o +.GetNotificationChannelVerificationCodeResponse +code ( / + expire_time ( 2.google.protobuf.Timestamp"z + VerifyNotificationChannelRequestC +name ( B5àAúA/ +-monitoring.googleapis.com/NotificationChannel +code ( BàA2ê +NotificationChannelServiceì +"ListNotificationChannelDescriptors?.google.monitoring.v3.ListNotificationChannelDescriptorsRequest@.google.monitoring.v3.ListNotificationChannelDescriptorsResponse"C‚Óä“64/v3/{name=projects/*}/notificationChannelDescriptorsÚAnameÝ + GetNotificationChannelDescriptor=.google.monitoring.v3.GetNotificationChannelDescriptorRequest3.google.monitoring.v3.NotificationChannelDescriptor"E‚Óä“86/v3/{name=projects/*/notificationChannelDescriptors/*}ÚAnameÄ +ListNotificationChannels5.google.monitoring.v3.ListNotificationChannelsRequest6.google.monitoring.v3.ListNotificationChannelsResponse"9‚Óä“,*/v3/{name=projects/*}/notificationChannelsÚAnameµ +GetNotificationChannel3.google.monitoring.v3.GetNotificationChannelRequest).google.monitoring.v3.NotificationChannel";‚Óä“.,/v3/{name=projects/*/notificationChannels/*}ÚAnameä +CreateNotificationChannel6.google.monitoring.v3.CreateNotificationChannelRequest).google.monitoring.v3.NotificationChannel"d‚Óä“B"*/v3/{name=projects/*}/notificationChannels:notification_channelÚAname,notification_channelƒ +UpdateNotificationChannel6.google.monitoring.v3.UpdateNotificationChannelRequest).google.monitoring.v3.NotificationChannel"‚‚Óä“Y2A/v3/{notification_channel.name=projects/*/notificationChannels/*}:notification_channelÚA update_mask,notification_channel® +DeleteNotificationChannel6.google.monitoring.v3.DeleteNotificationChannelRequest.google.protobuf.Empty"A‚Óä“.*,/v3/{name=projects/*/notificationChannels/*}ÚA +name,forceÜ +\'SendNotificationChannelVerificationCodeD.google.monitoring.v3.SendNotificationChannelVerificationCodeRequest.google.protobuf.Empty"S‚Óä“F"A/v3/{name=projects/*/notificationChannels/*}:sendVerificationCode:*ÚAname‡ +&GetNotificationChannelVerificationCodeC.google.monitoring.v3.GetNotificationChannelVerificationCodeRequestD.google.monitoring.v3.GetNotificationChannelVerificationCodeResponse"R‚Óä“E"@/v3/{name=projects/*/notificationChannels/*}:getVerificationCode:*ÚAnameÊ +VerifyNotificationChannel6.google.monitoring.v3.VerifyNotificationChannelRequest).google.monitoring.v3.NotificationChannel"J‚Óä“8"3/v3/{name=projects/*/notificationChannels/*}:verify:*ÚA name,code©ÊAmonitoring.googleapis.comÒA‰https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/monitoring,https://www.googleapis.com/auth/monitoring.readBÐ +com.google.monitoring.v3BNotificationServiceProtoPZ>google.golang.org/genproto/googleapis/monitoring/v3;monitoringªGoogle.Cloud.Monitoring.V3ÊGoogle\\Cloud\\Monitoring\\V3êGoogle::Cloud::Monitoring::V3bproto3' + , true); static::$is_initialized = true; } diff --git a/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/QueryService.php b/Monitoring/metadata/V3/QueryService.php similarity index 100% rename from owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/QueryService.php rename to Monitoring/metadata/V3/QueryService.php diff --git a/Monitoring/metadata/V3/Service.php b/Monitoring/metadata/V3/Service.php index b21615349f1..4aef5a25c91 100644 Binary files a/Monitoring/metadata/V3/Service.php and b/Monitoring/metadata/V3/Service.php differ diff --git a/Monitoring/metadata/V3/ServiceService.php b/Monitoring/metadata/V3/ServiceService.php index 3d080f9dd8f..f1b7d60262f 100644 --- a/Monitoring/metadata/V3/ServiceService.php +++ b/Monitoring/metadata/V3/ServiceService.php @@ -21,149 +21,73 @@ public static function initOnce() { \GPBMetadata\Google\Monitoring\V3\Service::initOnce(); \GPBMetadata\Google\Protobuf\GPBEmpty::initOnce(); \GPBMetadata\Google\Protobuf\FieldMask::initOnce(); - $pool->internalAddGeneratedFile(hex2bin( - "0af0200a2a676f6f676c652f6d6f6e69746f72696e672f76332f73657276" . - "6963655f736572766963652e70726f746f1214676f6f676c652e6d6f6e69" . - "746f72696e672e76331a17676f6f676c652f6170692f636c69656e742e70" . - "726f746f1a1f676f6f676c652f6170692f6669656c645f6265686176696f" . - "722e70726f746f1a19676f6f676c652f6170692f7265736f757263652e70" . - "726f746f1a22676f6f676c652f6d6f6e69746f72696e672f76332f736572" . - "766963652e70726f746f1a1b676f6f676c652f70726f746f6275662f656d" . - "7074792e70726f746f1a20676f6f676c652f70726f746f6275662f666965" . - "6c645f6d61736b2e70726f746f229a010a14437265617465536572766963" . - "655265717565737412390a06706172656e741801200128094229e04102fa" . - "412312216d6f6e69746f72696e672e676f6f676c65617069732e636f6d2f" . - "5365727669636512120a0a736572766963655f696418032001280912330a" . - "077365727669636518022001280b321d2e676f6f676c652e6d6f6e69746f" . - "72696e672e76332e536572766963654203e04102224c0a11476574536572" . - "766963655265717565737412370a046e616d651801200128094229e04102" . - "fa41230a216d6f6e69746f72696e672e676f6f676c65617069732e636f6d" . - "2f536572766963652287010a134c69737453657276696365735265717565" . - "737412390a06706172656e741801200128094229e04102fa412312216d6f" . - "6e69746f72696e672e676f6f676c65617069732e636f6d2f536572766963" . - "65120e0a0666696c74657218022001280912110a09706167655f73697a65" . - "18032001280512120a0a706167655f746f6b656e18042001280922600a14" . - "4c6973745365727669636573526573706f6e7365122f0a08736572766963" . - "657318012003280b321d2e676f6f676c652e6d6f6e69746f72696e672e76" . - "332e5365727669636512170a0f6e6578745f706167655f746f6b656e1802" . - "20012809227c0a1455706461746553657276696365526571756573741233" . - "0a077365727669636518012001280b321d2e676f6f676c652e6d6f6e6974" . - "6f72696e672e76332e536572766963654203e04102122f0a0b7570646174" . - "655f6d61736b18022001280b321a2e676f6f676c652e70726f746f627566" . - "2e4669656c644d61736b224f0a1444656c65746553657276696365526571" . - "7565737412370a046e616d651801200128094229e04102fa41230a216d6f" . - "6e69746f72696e672e676f6f676c65617069732e636f6d2f536572766963" . - "6522d6010a22437265617465536572766963654c6576656c4f626a656374" . - "6976655265717565737412390a06706172656e741801200128094229e041" . - "02fa41230a216d6f6e69746f72696e672e676f6f676c65617069732e636f" . - "6d2f5365727669636512220a1a736572766963655f6c6576656c5f6f626a" . - "6563746976655f696418032001280912510a17736572766963655f6c6576" . - "656c5f6f626a65637469766518022001280b322b2e676f6f676c652e6d6f" . - "6e69746f72696e672e76332e536572766963654c6576656c4f626a656374" . - "6976654203e0410222a8010a1f476574536572766963654c6576656c4f62" . - "6a6563746976655265717565737412450a046e616d651801200128094237" . - "e04102fa41310a2f6d6f6e69746f72696e672e676f6f676c65617069732e" . - "636f6d2f536572766963654c6576656c4f626a656374697665123e0a0476" . - "69657718022001280e32302e676f6f676c652e6d6f6e69746f72696e672e" . - "76332e536572766963654c6576656c4f626a6563746976652e5669657722" . - "d5010a214c697374536572766963654c6576656c4f626a65637469766573" . - "5265717565737412390a06706172656e741801200128094229e04102fa41" . - "230a216d6f6e69746f72696e672e676f6f676c65617069732e636f6d2f53" . - "657276696365120e0a0666696c74657218022001280912110a0970616765" . - "5f73697a6518032001280512120a0a706167655f746f6b656e1804200128" . - "09123e0a047669657718052001280e32302e676f6f676c652e6d6f6e6974" . - "6f72696e672e76332e536572766963654c6576656c4f626a656374697665" . - "2e56696577228c010a224c697374536572766963654c6576656c4f626a65" . - "637469766573526573706f6e7365124d0a18736572766963655f6c657665" . - "6c5f6f626a6563746976657318012003280b322b2e676f6f676c652e6d6f" . - "6e69746f72696e672e76332e536572766963654c6576656c4f626a656374" . - "69766512170a0f6e6578745f706167655f746f6b656e18022001280922a8" . - "010a22557064617465536572766963654c6576656c4f626a656374697665" . - "5265717565737412510a17736572766963655f6c6576656c5f6f626a6563" . - "7469766518012001280b322b2e676f6f676c652e6d6f6e69746f72696e67" . - "2e76332e536572766963654c6576656c4f626a6563746976654203e04102" . - "122f0a0b7570646174655f6d61736b18022001280b321a2e676f6f676c65" . - "2e70726f746f6275662e4669656c644d61736b226b0a2244656c65746553" . - "6572766963654c6576656c4f626a6563746976655265717565737412450a" . - "046e616d651801200128094237e04102fa41310a2f6d6f6e69746f72696e" . - "672e676f6f676c65617069732e636f6d2f536572766963654c6576656c4f" . - "626a65637469766532ea0f0a18536572766963654d6f6e69746f72696e67" . - "536572766963651297010a0d43726561746553657276696365122a2e676f" . - "6f676c652e6d6f6e69746f72696e672e76332e4372656174655365727669" . - "6365526571756573741a1d2e676f6f676c652e6d6f6e69746f72696e672e" . - "76332e53657276696365223b82d3e493022422192f76332f7b706172656e" . - "743d2a2f2a7d2f73657276696365733a0773657276696365da410e706172" . - "656e742c73657276696365127e0a0a4765745365727669636512272e676f" . - "6f676c652e6d6f6e69746f72696e672e76332e4765745365727669636552" . - "6571756573741a1d2e676f6f676c652e6d6f6e69746f72696e672e76332e" . - "53657276696365222882d3e493021b12192f76332f7b6e616d653d2a2f2a" . - "2f73657276696365732f2a7dda41046e616d651291010a0c4c6973745365" . - "72766963657312292e676f6f676c652e6d6f6e69746f72696e672e76332e" . - "4c6973745365727669636573526571756573741a2a2e676f6f676c652e6d" . - "6f6e69746f72696e672e76332e4c6973745365727669636573526573706f" . - "6e7365222a82d3e493021b12192f76332f7b706172656e743d2a2f2a7d2f" . - "7365727669636573da4106706172656e741298010a0d5570646174655365" . - "7276696365122a2e676f6f676c652e6d6f6e69746f72696e672e76332e55" . - "706461746553657276696365526571756573741a1d2e676f6f676c652e6d" . - "6f6e69746f72696e672e76332e53657276696365223c82d3e493022c3221" . - "2f76332f7b736572766963652e6e616d653d2a2f2a2f7365727669636573" . - "2f2a7d3a0773657276696365da410773657276696365127d0a0d44656c65" . - "746553657276696365122a2e676f6f676c652e6d6f6e69746f72696e672e" . - "76332e44656c65746553657276696365526571756573741a162e676f6f67" . - "6c652e70726f746f6275662e456d707479222882d3e493021b2a192f7633" . - "2f7b6e616d653d2a2f2a2f73657276696365732f2a7dda41046e616d6512" . - "fa010a1b437265617465536572766963654c6576656c4f626a6563746976" . - "6512382e676f6f676c652e6d6f6e69746f72696e672e76332e4372656174" . - "65536572766963654c6576656c4f626a656374697665526571756573741a" . - "2b2e676f6f676c652e6d6f6e69746f72696e672e76332e53657276696365" . - "4c6576656c4f626a656374697665227482d3e493024d22322f76332f7b70" . - "6172656e743d2a2f2a2f73657276696365732f2a7d2f736572766963654c" . - "6576656c4f626a656374697665733a17736572766963655f6c6576656c5f" . - "6f626a656374697665da411e706172656e742c736572766963655f6c6576" . - "656c5f6f626a65637469766512c1010a18476574536572766963654c6576" . - "656c4f626a65637469766512352e676f6f676c652e6d6f6e69746f72696e" . - "672e76332e476574536572766963654c6576656c4f626a65637469766552" . - "6571756573741a2b2e676f6f676c652e6d6f6e69746f72696e672e76332e" . - "536572766963654c6576656c4f626a656374697665224182d3e493023412" . - "322f76332f7b6e616d653d2a2f2a2f73657276696365732f2a2f73657276" . - "6963654c6576656c4f626a656374697665732f2a7dda41046e616d6512d4" . - "010a1a4c697374536572766963654c6576656c4f626a6563746976657312" . - "372e676f6f676c652e6d6f6e69746f72696e672e76332e4c697374536572" . - "766963654c6576656c4f626a65637469766573526571756573741a382e67" . - "6f6f676c652e6d6f6e69746f72696e672e76332e4c697374536572766963" . - "654c6576656c4f626a65637469766573526573706f6e7365224382d3e493" . - "023412322f76332f7b706172656e743d2a2f2a2f73657276696365732f2a" . - "7d2f736572766963654c6576656c4f626a65637469766573da4106706172" . - "656e74128c020a1b557064617465536572766963654c6576656c4f626a65" . - "637469766512382e676f6f676c652e6d6f6e69746f72696e672e76332e55" . - "7064617465536572766963654c6576656c4f626a65637469766552657175" . - "6573741a2b2e676f6f676c652e6d6f6e69746f72696e672e76332e536572" . - "766963654c6576656c4f626a65637469766522850182d3e4930265324a2f" . - "76332f7b736572766963655f6c6576656c5f6f626a6563746976652e6e61" . - "6d653d2a2f2a2f73657276696365732f2a2f736572766963654c6576656c" . - "4f626a656374697665732f2a7d3a17736572766963655f6c6576656c5f6f" . - "626a656374697665da4117736572766963655f6c6576656c5f6f626a6563" . - "7469766512b2010a1b44656c657465536572766963654c6576656c4f626a" . - "65637469766512382e676f6f676c652e6d6f6e69746f72696e672e76332e" . - "44656c657465536572766963654c6576656c4f626a656374697665526571" . - "756573741a162e676f6f676c652e70726f746f6275662e456d7074792241" . - "82d3e49302342a322f76332f7b6e616d653d2a2f2a2f7365727669636573" . - "2f2a2f736572766963654c6576656c4f626a656374697665732f2a7dda41" . - "046e616d651aa901ca41196d6f6e69746f72696e672e676f6f676c656170" . - "69732e636f6dd241890168747470733a2f2f7777772e676f6f676c656170" . - "69732e636f6d2f617574682f636c6f75642d706c6174666f726d2c687474" . - "70733a2f2f7777772e676f6f676c65617069732e636f6d2f617574682f6d" . - "6f6e69746f72696e672c68747470733a2f2f7777772e676f6f676c656170" . - "69732e636f6d2f617574682f6d6f6e69746f72696e672e7265616442d501" . - "0a18636f6d2e676f6f676c652e6d6f6e69746f72696e672e7633421d5365" . - "72766963654d6f6e69746f72696e675365727669636550726f746f50015a" . - "3e676f6f676c652e676f6c616e672e6f72672f67656e70726f746f2f676f" . - "6f676c65617069732f6d6f6e69746f72696e672f76333b6d6f6e69746f72" . - "696e67aa021a476f6f676c652e436c6f75642e4d6f6e69746f72696e672e" . - "5633ca021a476f6f676c655c436c6f75645c4d6f6e69746f72696e675c56" . - "33ea021d476f6f676c653a3a436c6f75643a3a4d6f6e69746f72696e673a" . - "3a5633620670726f746f33" - ), true); + $pool->internalAddGeneratedFile( + ' +ð +*google/monitoring/v3/service_service.protogoogle.monitoring.v3google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto"google/monitoring/v3/service.protogoogle/protobuf/empty.proto google/protobuf/field_mask.proto"š +CreateServiceRequest9 +parent ( B)àAúA#!monitoring.googleapis.com/Service + +service_id ( 3 +service ( 2.google.monitoring.v3.ServiceBàA"L +GetServiceRequest7 +name ( B)àAúA# +!monitoring.googleapis.com/Service"‡ +ListServicesRequest9 +parent ( B)àAúA#!monitoring.googleapis.com/Service +filter (  + page_size ( + +page_token ( "` +ListServicesResponse/ +services ( 2.google.monitoring.v3.Service +next_page_token ( "| +UpdateServiceRequest3 +service ( 2.google.monitoring.v3.ServiceBàA/ + update_mask ( 2.google.protobuf.FieldMask"O +DeleteServiceRequest7 +name ( B)àAúA# +!monitoring.googleapis.com/Service"Ö +"CreateServiceLevelObjectiveRequest9 +parent ( B)àAúA# +!monitoring.googleapis.com/Service" +service_level_objective_id ( Q +service_level_objective ( 2+.google.monitoring.v3.ServiceLevelObjectiveBàA"¨ +GetServiceLevelObjectiveRequestE +name ( B7àAúA1 +/monitoring.googleapis.com/ServiceLevelObjective> +view (20.google.monitoring.v3.ServiceLevelObjective.View"Õ +!ListServiceLevelObjectivesRequest9 +parent ( B)àAúA# +!monitoring.googleapis.com/Service +filter (  + page_size ( + +page_token ( > +view (20.google.monitoring.v3.ServiceLevelObjective.View"Œ +"ListServiceLevelObjectivesResponseM +service_level_objectives ( 2+.google.monitoring.v3.ServiceLevelObjective +next_page_token ( "¨ +"UpdateServiceLevelObjectiveRequestQ +service_level_objective ( 2+.google.monitoring.v3.ServiceLevelObjectiveBàA/ + update_mask ( 2.google.protobuf.FieldMask"k +"DeleteServiceLevelObjectiveRequestE +name ( B7àAúA1 +/monitoring.googleapis.com/ServiceLevelObjective2ê +ServiceMonitoringService— + CreateService*.google.monitoring.v3.CreateServiceRequest.google.monitoring.v3.Service";‚Óä“$"/v3/{parent=*/*}/services:serviceÚAparent,service~ + +GetService\'.google.monitoring.v3.GetServiceRequest.google.monitoring.v3.Service"(‚Óä“/v3/{name=*/*/services/*}ÚAname‘ + ListServices).google.monitoring.v3.ListServicesRequest*.google.monitoring.v3.ListServicesResponse"*‚Óä“/v3/{parent=*/*}/servicesÚAparent˜ + UpdateService*.google.monitoring.v3.UpdateServiceRequest.google.monitoring.v3.Service"<‚Óä“,2!/v3/{service.name=*/*/services/*}:serviceÚAservice} + DeleteService*.google.monitoring.v3.DeleteServiceRequest.google.protobuf.Empty"(‚Óä“*/v3/{name=*/*/services/*}ÚAnameú +CreateServiceLevelObjective8.google.monitoring.v3.CreateServiceLevelObjectiveRequest+.google.monitoring.v3.ServiceLevelObjective"t‚Óä“M"2/v3/{parent=*/*/services/*}/serviceLevelObjectives:service_level_objectiveÚAparent,service_level_objectiveÁ +GetServiceLevelObjective5.google.monitoring.v3.GetServiceLevelObjectiveRequest+.google.monitoring.v3.ServiceLevelObjective"A‚Óä“42/v3/{name=*/*/services/*/serviceLevelObjectives/*}ÚAnameÔ +ListServiceLevelObjectives7.google.monitoring.v3.ListServiceLevelObjectivesRequest8.google.monitoring.v3.ListServiceLevelObjectivesResponse"C‚Óä“42/v3/{parent=*/*/services/*}/serviceLevelObjectivesÚAparentŒ +UpdateServiceLevelObjective8.google.monitoring.v3.UpdateServiceLevelObjectiveRequest+.google.monitoring.v3.ServiceLevelObjective"…‚Óä“e2J/v3/{service_level_objective.name=*/*/services/*/serviceLevelObjectives/*}:service_level_objectiveÚAservice_level_objective² +DeleteServiceLevelObjective8.google.monitoring.v3.DeleteServiceLevelObjectiveRequest.google.protobuf.Empty"A‚Óä“4*2/v3/{name=*/*/services/*/serviceLevelObjectives/*}ÚAname©ÊAmonitoring.googleapis.comÒA‰https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/monitoring,https://www.googleapis.com/auth/monitoring.readBÕ +com.google.monitoring.v3BServiceMonitoringServiceProtoPZ>google.golang.org/genproto/googleapis/monitoring/v3;monitoringªGoogle.Cloud.Monitoring.V3ÊGoogle\\Cloud\\Monitoring\\V3êGoogle::Cloud::Monitoring::V3bproto3' + , true); static::$is_initialized = true; } diff --git a/Monitoring/metadata/V3/SpanContext.php b/Monitoring/metadata/V3/SpanContext.php index db690e55771..959e03af5ad 100644 --- a/Monitoring/metadata/V3/SpanContext.php +++ b/Monitoring/metadata/V3/SpanContext.php @@ -14,19 +14,14 @@ public static function initOnce() { if (static::$is_initialized == true) { return; } - $pool->internalAddGeneratedFile(hex2bin( - "0ab4020a27676f6f676c652f6d6f6e69746f72696e672f76332f7370616e" . - "5f636f6e746578742e70726f746f1214676f6f676c652e6d6f6e69746f72" . - "696e672e763322200a0b5370616e436f6e7465787412110a097370616e5f" . - "6e616d6518012001280942c8010a18636f6d2e676f6f676c652e6d6f6e69" . - "746f72696e672e763342105370616e436f6e7465787450726f746f50015a" . - "3e676f6f676c652e676f6c616e672e6f72672f67656e70726f746f2f676f" . - "6f676c65617069732f6d6f6e69746f72696e672f76333b6d6f6e69746f72" . - "696e67aa021a476f6f676c652e436c6f75642e4d6f6e69746f72696e672e" . - "5633ca021a476f6f676c655c436c6f75645c4d6f6e69746f72696e675c56" . - "33ea021d476f6f676c653a3a436c6f75643a3a4d6f6e69746f72696e673a" . - "3a5633620670726f746f33" - ), true); + $pool->internalAddGeneratedFile( + ' +´ +\'google/monitoring/v3/span_context.protogoogle.monitoring.v3" + SpanContext + span_name ( BÈ +com.google.monitoring.v3BSpanContextProtoPZ>google.golang.org/genproto/googleapis/monitoring/v3;monitoringªGoogle.Cloud.Monitoring.V3ÊGoogle\\Cloud\\Monitoring\\V3êGoogle::Cloud::Monitoring::V3bproto3' + , true); static::$is_initialized = true; } diff --git a/Monitoring/metadata/V3/Uptime.php b/Monitoring/metadata/V3/Uptime.php index 563d73af539..21923666291 100644 Binary files a/Monitoring/metadata/V3/Uptime.php and b/Monitoring/metadata/V3/Uptime.php differ diff --git a/Monitoring/metadata/V3/UptimeService.php b/Monitoring/metadata/V3/UptimeService.php index 3ca4219b4e5..3f79d39437f 100644 --- a/Monitoring/metadata/V3/UptimeService.php +++ b/Monitoring/metadata/V3/UptimeService.php @@ -18,108 +18,54 @@ public static function initOnce() { \GPBMetadata\Google\Api\Client::initOnce(); \GPBMetadata\Google\Api\FieldBehavior::initOnce(); \GPBMetadata\Google\Api\Resource::initOnce(); + \GPBMetadata\Google\Longrunning\Operations::initOnce(); \GPBMetadata\Google\Monitoring\V3\Uptime::initOnce(); \GPBMetadata\Google\Protobuf\Duration::initOnce(); \GPBMetadata\Google\Protobuf\GPBEmpty::initOnce(); \GPBMetadata\Google\Protobuf\FieldMask::initOnce(); - $pool->internalAddGeneratedFile(hex2bin( - "0aa5160a29676f6f676c652f6d6f6e69746f72696e672f76332f75707469" . - "6d655f736572766963652e70726f746f1214676f6f676c652e6d6f6e6974" . - "6f72696e672e76331a17676f6f676c652f6170692f636c69656e742e7072" . - "6f746f1a1f676f6f676c652f6170692f6669656c645f6265686176696f72" . - "2e70726f746f1a19676f6f676c652f6170692f7265736f757263652e7072" . - "6f746f1a21676f6f676c652f6d6f6e69746f72696e672f76332f75707469" . - "6d652e70726f746f1a1e676f6f676c652f70726f746f6275662f64757261" . - "74696f6e2e70726f746f1a1b676f6f676c652f70726f746f6275662f656d" . - "7074792e70726f746f1a20676f6f676c652f70726f746f6275662f666965" . - "6c645f6d61736b2e70726f746f228b010a1d4c697374557074696d654368" . - "65636b436f6e666967735265717565737412430a06706172656e74180120" . - "0128094233e04102fa412d122b6d6f6e69746f72696e672e676f6f676c65" . - "617069732e636f6d2f557074696d65436865636b436f6e66696712110a09" . - "706167655f73697a6518032001280512120a0a706167655f746f6b656e18" . - "04200128092294010a1e4c697374557074696d65436865636b436f6e6669" . - "6773526573706f6e736512450a14757074696d655f636865636b5f636f6e" . - "6669677318012003280b32272e676f6f676c652e6d6f6e69746f72696e67" . - "2e76332e557074696d65436865636b436f6e66696712170a0f6e6578745f" . - "706167655f746f6b656e18022001280912120a0a746f74616c5f73697a65" . - "18032001280522600a1b476574557074696d65436865636b436f6e666967" . - "5265717565737412410a046e616d651801200128094233e04102fa412d0a" . - "2b6d6f6e69746f72696e672e676f6f676c65617069732e636f6d2f557074" . - "696d65436865636b436f6e66696722b0010a1e437265617465557074696d" . - "65436865636b436f6e6669675265717565737412430a06706172656e7418" . - "01200128094233e04102fa412d122b6d6f6e69746f72696e672e676f6f67" . - "6c65617069732e636f6d2f557074696d65436865636b436f6e6669671249" . - "0a13757074696d655f636865636b5f636f6e66696718022001280b32272e" . - "676f6f676c652e6d6f6e69746f72696e672e76332e557074696d65436865" . - "636b436f6e6669674203e04102229c010a1e557064617465557074696d65" . - "436865636b436f6e66696752657175657374122f0a0b7570646174655f6d" . - "61736b18022001280b321a2e676f6f676c652e70726f746f6275662e4669" . - "656c644d61736b12490a13757074696d655f636865636b5f636f6e666967" . - "18032001280b32272e676f6f676c652e6d6f6e69746f72696e672e76332e" . - "557074696d65436865636b436f6e6669674203e0410222630a1e44656c65" . - "7465557074696d65436865636b436f6e6669675265717565737412410a04" . - "6e616d651801200128094233e04102fa412d0a2b6d6f6e69746f72696e67" . - "2e676f6f676c65617069732e636f6d2f557074696d65436865636b436f6e" . - "66696722420a194c697374557074696d65436865636b4970735265717565" . - "737412110a09706167655f73697a6518022001280512120a0a706167655f" . - "746f6b656e18032001280922740a1a4c697374557074696d65436865636b" . - "497073526573706f6e7365123d0a10757074696d655f636865636b5f6970" . - "7318012003280b32232e676f6f676c652e6d6f6e69746f72696e672e7633" . - "2e557074696d65436865636b497012170a0f6e6578745f706167655f746f" . - "6b656e18022001280932bd0a0a12557074696d65436865636b5365727669" . - "636512c0010a164c697374557074696d65436865636b436f6e6669677312" . - "332e676f6f676c652e6d6f6e69746f72696e672e76332e4c697374557074" . - "696d65436865636b436f6e66696773526571756573741a342e676f6f676c" . - "652e6d6f6e69746f72696e672e76332e4c697374557074696d6543686563" . - "6b436f6e66696773526573706f6e7365223b82d3e493022c122a2f76332f" . - "7b706172656e743d70726f6a656374732f2a7d2f757074696d6543686563" . - "6b436f6e66696773da4106706172656e7412ad010a14476574557074696d" . - "65436865636b436f6e66696712312e676f6f676c652e6d6f6e69746f7269" . - "6e672e76332e476574557074696d65436865636b436f6e66696752657175" . - "6573741a272e676f6f676c652e6d6f6e69746f72696e672e76332e557074" . - "696d65436865636b436f6e666967223982d3e493022c122a2f76332f7b6e" . - "616d653d70726f6a656374732f2a2f757074696d65436865636b436f6e66" . - "6967732f2a7dda41046e616d6512de010a17437265617465557074696d65" . - "436865636b436f6e66696712342e676f6f676c652e6d6f6e69746f72696e" . - "672e76332e437265617465557074696d65436865636b436f6e6669675265" . - "71756573741a272e676f6f676c652e6d6f6e69746f72696e672e76332e55" . - "7074696d65436865636b436f6e666967226482d3e4930241222a2f76332f" . - "7b706172656e743d70726f6a656374732f2a7d2f757074696d6543686563" . - "6b436f6e666967733a13757074696d655f636865636b5f636f6e666967da" . - "411a706172656e742c757074696d655f636865636b5f636f6e66696712eb" . - "010a17557064617465557074696d65436865636b436f6e66696712342e67" . - "6f6f676c652e6d6f6e69746f72696e672e76332e55706461746555707469" . - "6d65436865636b436f6e666967526571756573741a272e676f6f676c652e" . - "6d6f6e69746f72696e672e76332e557074696d65436865636b436f6e6669" . - "67227182d3e4930255323e2f76332f7b757074696d655f636865636b5f63" . - "6f6e6669672e6e616d653d70726f6a656374732f2a2f757074696d654368" . - "65636b436f6e666967732f2a7d3a13757074696d655f636865636b5f636f" . - "6e666967da4113757074696d655f636865636b5f636f6e66696712a2010a" . - "1744656c657465557074696d65436865636b436f6e66696712342e676f6f" . - "676c652e6d6f6e69746f72696e672e76332e44656c657465557074696d65" . - "436865636b436f6e666967526571756573741a162e676f6f676c652e7072" . - "6f746f6275662e456d707479223982d3e493022c2a2a2f76332f7b6e616d" . - "653d70726f6a656374732f2a2f757074696d65436865636b436f6e666967" . - "732f2a7dda41046e616d651293010a124c697374557074696d6543686563" . - "6b497073122f2e676f6f676c652e6d6f6e69746f72696e672e76332e4c69" . - "7374557074696d65436865636b497073526571756573741a302e676f6f67" . - "6c652e6d6f6e69746f72696e672e76332e4c697374557074696d65436865" . - "636b497073526573706f6e7365221a82d3e493021412122f76332f757074" . - "696d65436865636b4970731aa901ca41196d6f6e69746f72696e672e676f" . - "6f676c65617069732e636f6dd241890168747470733a2f2f7777772e676f" . - "6f676c65617069732e636f6d2f617574682f636c6f75642d706c6174666f" . - "726d2c68747470733a2f2f7777772e676f6f676c65617069732e636f6d2f" . - "617574682f6d6f6e69746f72696e672c68747470733a2f2f7777772e676f" . - "6f676c65617069732e636f6d2f617574682f6d6f6e69746f72696e672e72" . - "65616442ca010a18636f6d2e676f6f676c652e6d6f6e69746f72696e672e" . - "76334212557074696d655365727669636550726f746f50015a3e676f6f67" . - "6c652e676f6c616e672e6f72672f67656e70726f746f2f676f6f676c6561" . - "7069732f6d6f6e69746f72696e672f76333b6d6f6e69746f72696e67aa02" . - "1a476f6f676c652e436c6f75642e4d6f6e69746f72696e672e5633ca021a" . - "476f6f676c655c436c6f75645c4d6f6e69746f72696e675c5633ea021d47" . - "6f6f676c653a3a436c6f75643a3a4d6f6e69746f72696e673a3a56336206" . - "70726f746f33" - ), true); + $pool->internalAddGeneratedFile( + ' +Ê +)google/monitoring/v3/uptime_service.protogoogle.monitoring.v3google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto#google/longrunning/operations.proto!google/monitoring/v3/uptime.protogoogle/protobuf/duration.protogoogle/protobuf/empty.proto google/protobuf/field_mask.proto"‹ +ListUptimeCheckConfigsRequestC +parent ( B3àAúA-+monitoring.googleapis.com/UptimeCheckConfig + page_size ( + +page_token ( "” +ListUptimeCheckConfigsResponseE +uptime_check_configs ( 2\'.google.monitoring.v3.UptimeCheckConfig +next_page_token (  + +total_size ("` +GetUptimeCheckConfigRequestA +name ( B3àAúA- ++monitoring.googleapis.com/UptimeCheckConfig"° +CreateUptimeCheckConfigRequestC +parent ( B3àAúA-+monitoring.googleapis.com/UptimeCheckConfigI +uptime_check_config ( 2\'.google.monitoring.v3.UptimeCheckConfigBàA"œ +UpdateUptimeCheckConfigRequest/ + update_mask ( 2.google.protobuf.FieldMaskI +uptime_check_config ( 2\'.google.monitoring.v3.UptimeCheckConfigBàA"c +DeleteUptimeCheckConfigRequestA +name ( B3àAúA- ++monitoring.googleapis.com/UptimeCheckConfig"B +ListUptimeCheckIpsRequest + page_size ( + +page_token ( "t +ListUptimeCheckIpsResponse= +uptime_check_ips ( 2#.google.monitoring.v3.UptimeCheckIp +next_page_token ( 2½ + +UptimeCheckServiceÀ +ListUptimeCheckConfigs3.google.monitoring.v3.ListUptimeCheckConfigsRequest4.google.monitoring.v3.ListUptimeCheckConfigsResponse";‚Óä“,*/v3/{parent=projects/*}/uptimeCheckConfigsÚAparent­ +GetUptimeCheckConfig1.google.monitoring.v3.GetUptimeCheckConfigRequest\'.google.monitoring.v3.UptimeCheckConfig"9‚Óä“,*/v3/{name=projects/*/uptimeCheckConfigs/*}ÚAnameÞ +CreateUptimeCheckConfig4.google.monitoring.v3.CreateUptimeCheckConfigRequest\'.google.monitoring.v3.UptimeCheckConfig"d‚Óä“A"*/v3/{parent=projects/*}/uptimeCheckConfigs:uptime_check_configÚAparent,uptime_check_configë +UpdateUptimeCheckConfig4.google.monitoring.v3.UpdateUptimeCheckConfigRequest\'.google.monitoring.v3.UptimeCheckConfig"q‚Óä“U2>/v3/{uptime_check_config.name=projects/*/uptimeCheckConfigs/*}:uptime_check_configÚAuptime_check_config¢ +DeleteUptimeCheckConfig4.google.monitoring.v3.DeleteUptimeCheckConfigRequest.google.protobuf.Empty"9‚Óä“,**/v3/{name=projects/*/uptimeCheckConfigs/*}ÚAname“ +ListUptimeCheckIps/.google.monitoring.v3.ListUptimeCheckIpsRequest0.google.monitoring.v3.ListUptimeCheckIpsResponse"‚Óä“/v3/uptimeCheckIps©ÊAmonitoring.googleapis.comÒA‰https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/monitoring,https://www.googleapis.com/auth/monitoring.readBÊ +com.google.monitoring.v3BUptimeServiceProtoPZ>google.golang.org/genproto/googleapis/monitoring/v3;monitoringªGoogle.Cloud.Monitoring.V3ÊGoogle\\Cloud\\Monitoring\\V3êGoogle::Cloud::Monitoring::V3bproto3' + , true); static::$is_initialized = true; } diff --git a/Monitoring/src/V3/Aggregation.php b/Monitoring/src/V3/Aggregation.php index a3cf18f7d00..bce4facea7b 100644 --- a/Monitoring/src/V3/Aggregation.php +++ b/Monitoring/src/V3/Aggregation.php @@ -43,10 +43,12 @@ class Aggregation extends \Google\Protobuf\Internal\Message * [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 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; */ @@ -119,10 +121,12 @@ class Aggregation extends \Google\Protobuf\Internal\Message * [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 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 @@ -179,29 +183,43 @@ public function __construct($data = NULL) { * [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 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 + * @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 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 @@ -261,7 +279,7 @@ public function getPerSeriesAligner() */ public function setPerSeriesAligner($var) { - GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\Aggregation_Aligner::class); + GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\Aggregation\Aligner::class); $this->per_series_aligner = $var; return $this; @@ -309,7 +327,7 @@ public function getCrossSeriesReducer() */ public function setCrossSeriesReducer($var) { - GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\Aggregation_Reducer::class); + GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\Aggregation\Reducer::class); $this->cross_series_reducer = $var; return $this; diff --git a/Monitoring/src/V3/AlertPolicy.php b/Monitoring/src/V3/AlertPolicy.php index 0ef95d64d09..51020322f39 100644 --- a/Monitoring/src/V3/AlertPolicy.php +++ b/Monitoring/src/V3/AlertPolicy.php @@ -23,7 +23,7 @@ class AlertPolicy extends \Google\Protobuf\Internal\Message * format is: * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] * `[ALERT_POLICY_ID]` is assigned by Stackdriver Monitoring when the policy - * is created. When calling the + * 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. @@ -126,6 +126,12 @@ class AlertPolicy extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.monitoring.v3.MutationRecord mutation_record = 11; */ private $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; + */ + private $alert_strategy = null; /** * Constructor. @@ -138,7 +144,7 @@ class AlertPolicy extends \Google\Protobuf\Internal\Message * format is: * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] * `[ALERT_POLICY_ID]` is assigned by Stackdriver Monitoring when the policy - * is created. When calling the + * 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. @@ -197,6 +203,8 @@ class AlertPolicy extends \Google\Protobuf\Internal\Message * @type \Google\Cloud\Monitoring\V3\MutationRecord $mutation_record * A read-only record of the most recent change to the alerting policy. If * provided in a call to create or update, this field will be ignored. + * @type \Google\Cloud\Monitoring\V3\AlertPolicy\AlertStrategy $alert_strategy + * Control over how this alert policy's notification channels are notified. * } */ public function __construct($data = NULL) { @@ -209,7 +217,7 @@ public function __construct($data = NULL) { * format is: * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] * `[ALERT_POLICY_ID]` is assigned by Stackdriver Monitoring when the policy - * is created. When calling the + * 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. @@ -227,7 +235,7 @@ public function getName() * format is: * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] * `[ALERT_POLICY_ID]` is assigned by Stackdriver Monitoring when the policy - * is created. When calling the + * 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. @@ -284,13 +292,23 @@ public function setDisplayName($var) * 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 + * @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 @@ -304,7 +322,7 @@ public function getDocumentation() */ public function setDocumentation($var) { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\AlertPolicy_Documentation::class); + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\AlertPolicy\Documentation::class); $this->documentation = $var; return $this; @@ -408,7 +426,7 @@ public function getCombiner() */ public function setCombiner($var) { - GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\AlertPolicy_ConditionCombinerType::class); + GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\AlertPolicy\ConditionCombinerType::class); $this->combiner = $var; return $this; @@ -422,13 +440,23 @@ public function setCombiner($var) * a field projection has been specified that strips it out. * * Generated from protobuf field .google.protobuf.BoolValue enabled = 17; - * @return \Google\Protobuf\BoolValue + * @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() @@ -488,13 +516,23 @@ public function setEnabledValue($var) * policy is valid. If not OK, the alert policy will not generate incidents. * * Generated from protobuf field .google.rpc.Status validity = 18; - * @return \Google\Rpc\Status + * @return \Google\Rpc\Status|null */ public function getValidity() { return $this->validity; } + public function hasValidity() + { + return isset($this->validity); + } + + public function clearValidity() + { + unset($this->validity); + } + /** * Read-only description of how the alert policy is invalid. OK if the alert * policy is valid. If not OK, the alert policy will not generate incidents. @@ -558,13 +596,23 @@ public function setNotificationChannels($var) * 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 + * @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. @@ -586,13 +634,23 @@ public function setCreationRecord($var) * 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 + * @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. @@ -609,5 +667,41 @@ public function setMutationRecord($var) return $this; } + /** + * Control over how this alert policy's notification channels are notified. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy.AlertStrategy alert_strategy = 21; + * @return \Google\Cloud\Monitoring\V3\AlertPolicy\AlertStrategy|null + */ + public function getAlertStrategy() + { + return $this->alert_strategy; + } + + public function hasAlertStrategy() + { + return isset($this->alert_strategy); + } + + public function clearAlertStrategy() + { + unset($this->alert_strategy); + } + + /** + * Control over how this alert policy's notification channels are notified. + * + * Generated from protobuf field .google.monitoring.v3.AlertPolicy.AlertStrategy alert_strategy = 21; + * @param \Google\Cloud\Monitoring\V3\AlertPolicy\AlertStrategy $var + * @return $this + */ + public function setAlertStrategy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\AlertPolicy\AlertStrategy::class); + $this->alert_strategy = $var; + + return $this; + } + } diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/AlertStrategy.php b/Monitoring/src/V3/AlertPolicy/AlertStrategy.php similarity index 98% rename from owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/AlertStrategy.php rename to Monitoring/src/V3/AlertPolicy/AlertStrategy.php index 03447c55f0f..6aaf9a89f10 100644 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/AlertStrategy.php +++ b/Monitoring/src/V3/AlertPolicy/AlertStrategy.php @@ -22,14 +22,14 @@ class AlertStrategy extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationRateLimit notification_rate_limit = 1; */ - protected $notification_rate_limit = null; + private $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; + private $auto_close = null; /** * Constructor. diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/AlertStrategy/NotificationRateLimit.php b/Monitoring/src/V3/AlertPolicy/AlertStrategy/NotificationRateLimit.php similarity index 98% rename from owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/AlertStrategy/NotificationRateLimit.php rename to Monitoring/src/V3/AlertPolicy/AlertStrategy/NotificationRateLimit.php index a487e3fd361..3df6a8d2d95 100644 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/AlertStrategy/NotificationRateLimit.php +++ b/Monitoring/src/V3/AlertPolicy/AlertStrategy/NotificationRateLimit.php @@ -21,7 +21,7 @@ class NotificationRateLimit extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Duration period = 1; */ - protected $period = null; + private $period = null; /** * Constructor. diff --git a/Monitoring/src/V3/AlertPolicy/Condition.php b/Monitoring/src/V3/AlertPolicy/Condition.php index 6058da4752f..a9759b44754 100644 --- a/Monitoring/src/V3/AlertPolicy/Condition.php +++ b/Monitoring/src/V3/AlertPolicy/Condition.php @@ -88,10 +88,12 @@ class Condition extends \Google\Protobuf\Internal\Message * @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\TimeSeriesQueryLanguageCondition $condition_time_series_query_language + * @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. - * If set, no other conditions can be present. * } */ public function __construct($data = NULL) { @@ -197,13 +199,18 @@ public function setDisplayName($var) * 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 + * @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. * @@ -213,7 +220,7 @@ public function getConditionThreshold() */ public function setConditionThreshold($var) { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\AlertPolicy_Condition_MetricThreshold::class); + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\MetricThreshold::class); $this->writeOneof(1, $var); return $this; @@ -224,13 +231,18 @@ public function setConditionThreshold($var) * 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 + * @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. @@ -241,38 +253,74 @@ public function getConditionAbsent() */ public function setConditionAbsent($var) { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\AlertPolicy_Condition_MetricAbsence::class); + 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. - * If set, no other conditions can be present. * - * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition condition_time_series_query_language = 14; - * @return \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\TimeSeriesQueryLanguageCondition + * 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 getConditionTimeSeriesQueryLanguage() + public function getConditionMonitoringQueryLanguage() + { + return $this->readOneof(19); + } + + public function hasConditionMonitoringQueryLanguage() { - return $this->readOneof(14); + return $this->hasOneof(19); } /** * A condition that uses the Monitoring Query Language to define * alerts. - * If set, no other conditions can be present. * - * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition condition_time_series_query_language = 14; - * @param \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\TimeSeriesQueryLanguageCondition $var + * 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 setConditionTimeSeriesQueryLanguage($var) + public function setConditionMonitoringQueryLanguage($var) { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\AlertPolicy_Condition_TimeSeriesQueryLanguageCondition::class); - $this->writeOneof(14, $var); + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\MonitoringQueryLanguageCondition::class); + $this->writeOneof(19, $var); return $this; } diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/LogMatch.php b/Monitoring/src/V3/AlertPolicy/Condition/LogMatch.php similarity index 99% rename from owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/LogMatch.php rename to Monitoring/src/V3/AlertPolicy/Condition/LogMatch.php index cd52e655a01..0b94984551f 100644 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/LogMatch.php +++ b/Monitoring/src/V3/AlertPolicy/Condition/LogMatch.php @@ -25,7 +25,7 @@ class LogMatch extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string filter = 1 [(.google.api.field_behavior) = REQUIRED]; */ - protected $filter = ''; + private $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 diff --git a/Monitoring/src/V3/AlertPolicy/Condition/MetricAbsence.php b/Monitoring/src/V3/AlertPolicy/Condition/MetricAbsence.php index ca3c3a5838d..d3ae3b5d11c 100644 --- a/Monitoring/src/V3/AlertPolicy/Condition/MetricAbsence.php +++ b/Monitoring/src/V3/AlertPolicy/Condition/MetricAbsence.php @@ -20,17 +20,17 @@ class MetricAbsence extends \Google\Protobuf\Internal\Message { /** - * A [filter](https://cloud.google.com/monitoring/api/v3/filters) that + * 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) and 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. + * 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; + * Generated from protobuf field string filter = 1 [(.google.api.field_behavior) = REQUIRED]; */ private $filter = ''; /** @@ -38,7 +38,7 @@ class MetricAbsence extends \Google\Protobuf\Internal\Message * 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 resrouces). Multiple aggregations + * 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). @@ -50,9 +50,10 @@ class MetricAbsence extends \Google\Protobuf\Internal\Message private $aggregations; /** * The amount of time that a time series must fail to report new - * data to be considered failing. Currently, only values that - * are a multiple of a minute--e.g. 60, 120, or 300 - * seconds--are supported. If an invalid value is given, an + * 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. * @@ -76,21 +77,21 @@ class MetricAbsence extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $filter - * A [filter](https://cloud.google.com/monitoring/api/v3/filters) that + * 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) and 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. + * processed). The filter must specify the metric type and the resource + * type. Optionally, it can specify resource labels and metric labels. + * This field must not exceed 2048 Unicode characters in length. * @type \Google\Cloud\Monitoring\V3\Aggregation[]|\Google\Protobuf\Internal\RepeatedField $aggregations * Specifies the alignment of data points in individual time series as * well as how to combine the retrieved time series together (such as * when aggregating multiple streams on each resource to a single * stream for each resource or when aggregating streams across all - * members of a group of resrouces). Multiple aggregations + * 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). @@ -98,9 +99,10 @@ class MetricAbsence extends \Google\Protobuf\Internal\Message * field. * @type \Google\Protobuf\Duration $duration * The amount of time that a time series must fail to report new - * data to be considered failing. Currently, only values that - * are a multiple of a minute--e.g. 60, 120, or 300 - * seconds--are supported. If an invalid value is given, an + * 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 @@ -116,17 +118,17 @@ public function __construct($data = NULL) { } /** - * A [filter](https://cloud.google.com/monitoring/api/v3/filters) that + * 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) and 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. + * 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; + * Generated from protobuf field string filter = 1 [(.google.api.field_behavior) = REQUIRED]; * @return string */ public function getFilter() @@ -135,17 +137,17 @@ public function getFilter() } /** - * A [filter](https://cloud.google.com/monitoring/api/v3/filters) that + * 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) and 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. + * 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; + * Generated from protobuf field string filter = 1 [(.google.api.field_behavior) = REQUIRED]; * @param string $var * @return $this */ @@ -162,7 +164,7 @@ public function setFilter($var) * 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 resrouces). Multiple aggregations + * 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). @@ -182,7 +184,7 @@ public function getAggregations() * 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 resrouces). Multiple aggregations + * 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). @@ -203,25 +205,37 @@ public function setAggregations($var) /** * The amount of time that a time series must fail to report new - * data to be considered failing. Currently, only values that - * are a multiple of a minute--e.g. 60, 120, or 300 - * seconds--are supported. If an invalid value is given, an + * 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 + * @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. Currently, only values that - * are a multiple of a minute--e.g. 60, 120, or 300 - * seconds--are supported. If an invalid value is given, an + * 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. * @@ -244,13 +258,23 @@ public function setDuration($var) * 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 + * @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 @@ -263,7 +287,7 @@ public function getTrigger() */ public function setTrigger($var) { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\AlertPolicy_Condition_Trigger::class); + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\Trigger::class); $this->trigger = $var; return $this; diff --git a/Monitoring/src/V3/AlertPolicy/Condition/MetricThreshold.php b/Monitoring/src/V3/AlertPolicy/Condition/MetricThreshold.php index cecfbac36fe..0cd2af84df2 100644 --- a/Monitoring/src/V3/AlertPolicy/Condition/MetricThreshold.php +++ b/Monitoring/src/V3/AlertPolicy/Condition/MetricThreshold.php @@ -17,17 +17,17 @@ class MetricThreshold extends \Google\Protobuf\Internal\Message { /** - * A [filter](https://cloud.google.com/monitoring/api/v3/filters) that + * 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) and 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. + * 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; + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = REQUIRED]; */ private $filter = ''; /** @@ -35,7 +35,7 @@ class MetricThreshold extends \Google\Protobuf\Internal\Message * 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 resrouces). Multiple aggregations + * 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). @@ -122,21 +122,21 @@ class MetricThreshold extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $filter - * A [filter](https://cloud.google.com/monitoring/api/v3/filters) that + * 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) and 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. + * processed). The filter must specify the metric type and the resource + * type. Optionally, it can specify resource labels and metric labels. + * This field must not exceed 2048 Unicode characters in length. * @type \Google\Cloud\Monitoring\V3\Aggregation[]|\Google\Protobuf\Internal\RepeatedField $aggregations * Specifies the alignment of data points in individual time series as * well as how to combine the retrieved time series together (such as * when aggregating multiple streams on each resource to a single * stream for each resource or when aggregating streams across all - * members of a group of resrouces). Multiple aggregations + * 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). @@ -195,17 +195,17 @@ public function __construct($data = NULL) { } /** - * A [filter](https://cloud.google.com/monitoring/api/v3/filters) that + * 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) and 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. + * 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; + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = REQUIRED]; * @return string */ public function getFilter() @@ -214,17 +214,17 @@ public function getFilter() } /** - * A [filter](https://cloud.google.com/monitoring/api/v3/filters) that + * 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) and 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. + * 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; + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = REQUIRED]; * @param string $var * @return $this */ @@ -241,7 +241,7 @@ public function setFilter($var) * 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 resrouces). Multiple aggregations + * 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). @@ -261,7 +261,7 @@ public function getAggregations() * 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 resrouces). Multiple aggregations + * 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). @@ -435,13 +435,23 @@ public function setThresholdValue($var) * unhealthy states are detected and alerted on quickly. * * Generated from protobuf field .google.protobuf.Duration duration = 6; - * @return \Google\Protobuf\Duration + * @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 @@ -475,13 +485,23 @@ public function setDuration($var) * are specified. * * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 7; - * @return \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\Trigger + * @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 @@ -496,7 +516,7 @@ public function getTrigger() */ public function setTrigger($var) { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\AlertPolicy_Condition_Trigger::class); + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\Trigger::class); $this->trigger = $var; return $this; diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/MonitoringQueryLanguageCondition.php b/Monitoring/src/V3/AlertPolicy/Condition/MonitoringQueryLanguageCondition.php similarity index 98% rename from owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/MonitoringQueryLanguageCondition.php rename to Monitoring/src/V3/AlertPolicy/Condition/MonitoringQueryLanguageCondition.php index 90d7dce23eb..0bbd1dd0729 100644 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/MonitoringQueryLanguageCondition.php +++ b/Monitoring/src/V3/AlertPolicy/Condition/MonitoringQueryLanguageCondition.php @@ -22,7 +22,7 @@ class MonitoringQueryLanguageCondition extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string query = 1; */ - protected $query = ''; + private $query = ''; /** * The amount of time that a time series must violate the * threshold to be considered failing. Currently, only values @@ -37,7 +37,7 @@ class MonitoringQueryLanguageCondition extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Duration duration = 2; */ - protected $duration = null; + private $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 @@ -48,7 +48,7 @@ class MonitoringQueryLanguageCondition extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; */ - protected $trigger = null; + private $trigger = null; /** * Constructor. diff --git a/Monitoring/src/V3/AlertPolicy/Condition/Trigger.php b/Monitoring/src/V3/AlertPolicy/Condition/Trigger.php index 2658eec42c7..8daaca29380 100644 --- a/Monitoring/src/V3/AlertPolicy/Condition/Trigger.php +++ b/Monitoring/src/V3/AlertPolicy/Condition/Trigger.php @@ -49,6 +49,11 @@ 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. @@ -77,6 +82,11 @@ 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. diff --git a/Monitoring/src/V3/AlertPolicyServiceClient.php b/Monitoring/src/V3/AlertPolicyServiceClient.php index 87627fbe849..46a07e247fb 100644 --- a/Monitoring/src/V3/AlertPolicyServiceClient.php +++ b/Monitoring/src/V3/AlertPolicyServiceClient.php @@ -17,20 +17,18 @@ /* * GENERATED CODE WARNING - * This file was generated from the file - * https://github.com/google/googleapis/blob/master/google/monitoring/v3/alert_service.proto - * and updates to that file get reflected here through a refresh process. + * Generated by gapic-generator-php from the file + * https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/alert_service.proto + * Updates to the above are reflected here through a refresh process. */ namespace Google\Cloud\Monitoring\V3; use Google\Cloud\Monitoring\V3\Gapic\AlertPolicyServiceGapicClient; -/** - * {@inheritdoc} - */ +/** {@inheritdoc} */ class AlertPolicyServiceClient extends AlertPolicyServiceGapicClient { - // This class is intentionally empty, and is intended to hold manual - // additions to the generated {@see AlertPolicyServiceGapicClient} class. + // This class is intentionally empty, and is intended to hold manual additions to + // the generated {@see AlertPolicyServiceGapicClient} class. } diff --git a/Monitoring/src/V3/AlertPolicyServiceGrpcClient.php b/Monitoring/src/V3/AlertPolicyServiceGrpcClient.php index e6d90224c63..8b6aa892549 100644 --- a/Monitoring/src/V3/AlertPolicyServiceGrpcClient.php +++ b/Monitoring/src/V3/AlertPolicyServiceGrpcClient.php @@ -41,10 +41,11 @@ public function __construct($hostname, $opts, $channel = null) { } /** - * Lists the existing alerting policies for the project. + * Lists the existing alerting policies for the workspace. * @param \Google\Cloud\Monitoring\V3\ListAlertPoliciesRequest $argument input argument * @param array $metadata metadata * @param array $options call options + * @return \Grpc\UnaryCall */ public function ListAlertPolicies(\Google\Cloud\Monitoring\V3\ListAlertPoliciesRequest $argument, $metadata = [], $options = []) { @@ -59,6 +60,7 @@ public function ListAlertPolicies(\Google\Cloud\Monitoring\V3\ListAlertPoliciesR * @param \Google\Cloud\Monitoring\V3\GetAlertPolicyRequest $argument input argument * @param array $metadata metadata * @param array $options call options + * @return \Grpc\UnaryCall */ public function GetAlertPolicy(\Google\Cloud\Monitoring\V3\GetAlertPolicyRequest $argument, $metadata = [], $options = []) { @@ -73,6 +75,7 @@ public function GetAlertPolicy(\Google\Cloud\Monitoring\V3\GetAlertPolicyRequest * @param \Google\Cloud\Monitoring\V3\CreateAlertPolicyRequest $argument input argument * @param array $metadata metadata * @param array $options call options + * @return \Grpc\UnaryCall */ public function CreateAlertPolicy(\Google\Cloud\Monitoring\V3\CreateAlertPolicyRequest $argument, $metadata = [], $options = []) { @@ -87,6 +90,7 @@ public function CreateAlertPolicy(\Google\Cloud\Monitoring\V3\CreateAlertPolicyR * @param \Google\Cloud\Monitoring\V3\DeleteAlertPolicyRequest $argument input argument * @param array $metadata metadata * @param array $options call options + * @return \Grpc\UnaryCall */ public function DeleteAlertPolicy(\Google\Cloud\Monitoring\V3\DeleteAlertPolicyRequest $argument, $metadata = [], $options = []) { @@ -104,6 +108,7 @@ public function DeleteAlertPolicy(\Google\Cloud\Monitoring\V3\DeleteAlertPolicyR * @param \Google\Cloud\Monitoring\V3\UpdateAlertPolicyRequest $argument input argument * @param array $metadata metadata * @param array $options call options + * @return \Grpc\UnaryCall */ public function UpdateAlertPolicy(\Google\Cloud\Monitoring\V3\UpdateAlertPolicyRequest $argument, $metadata = [], $options = []) { diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy_AlertStrategy.php b/Monitoring/src/V3/AlertPolicy_AlertStrategy.php similarity index 100% rename from owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy_AlertStrategy.php rename to Monitoring/src/V3/AlertPolicy_AlertStrategy.php diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy_AlertStrategy_NotificationRateLimit.php b/Monitoring/src/V3/AlertPolicy_AlertStrategy_NotificationRateLimit.php similarity index 100% rename from owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy_AlertStrategy_NotificationRateLimit.php rename to Monitoring/src/V3/AlertPolicy_AlertStrategy_NotificationRateLimit.php diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy_Condition_LogMatch.php b/Monitoring/src/V3/AlertPolicy_Condition_LogMatch.php similarity index 100% rename from owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy_Condition_LogMatch.php rename to Monitoring/src/V3/AlertPolicy_Condition_LogMatch.php diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy_Condition_MonitoringQueryLanguageCondition.php b/Monitoring/src/V3/AlertPolicy_Condition_MonitoringQueryLanguageCondition.php similarity index 100% rename from owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy_Condition_MonitoringQueryLanguageCondition.php rename to Monitoring/src/V3/AlertPolicy_Condition_MonitoringQueryLanguageCondition.php diff --git a/Monitoring/src/V3/BasicSli.php b/Monitoring/src/V3/BasicSli.php index 852a770f4df..b98ce3a9b13 100644 --- a/Monitoring/src/V3/BasicSli.php +++ b/Monitoring/src/V3/BasicSli.php @@ -196,13 +196,18 @@ public function setVersion($var) * that return successfully. * * Generated from protobuf field .google.monitoring.v3.BasicSli.AvailabilityCriteria availability = 2; - * @return \Google\Cloud\Monitoring\V3\BasicSli\AvailabilityCriteria + * @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. @@ -213,7 +218,7 @@ public function getAvailability() */ public function setAvailability($var) { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\BasicSli_AvailabilityCriteria::class); + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\BasicSli\AvailabilityCriteria::class); $this->writeOneof(2, $var); return $this; @@ -224,13 +229,18 @@ public function setAvailability($var) * 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 + * @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`. @@ -241,7 +251,7 @@ public function getLatency() */ public function setLatency($var) { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\BasicSli_LatencyCriteria::class); + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\BasicSli\LatencyCriteria::class); $this->writeOneof(3, $var); return $this; diff --git a/Monitoring/src/V3/BasicSli/LatencyCriteria.php b/Monitoring/src/V3/BasicSli/LatencyCriteria.php index 77208c807d7..9839567a343 100644 --- a/Monitoring/src/V3/BasicSli/LatencyCriteria.php +++ b/Monitoring/src/V3/BasicSli/LatencyCriteria.php @@ -44,13 +44,23 @@ public function __construct($data = NULL) { * that return in no more than `threshold`. * * Generated from protobuf field .google.protobuf.Duration threshold = 3; - * @return \Google\Protobuf\Duration + * @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`. diff --git a/Monitoring/src/V3/CreateAlertPolicyRequest.php b/Monitoring/src/V3/CreateAlertPolicyRequest.php index 7b3bd8e80ed..27ab390813d 100644 --- a/Monitoring/src/V3/CreateAlertPolicyRequest.php +++ b/Monitoring/src/V3/CreateAlertPolicyRequest.php @@ -16,13 +16,15 @@ class CreateAlertPolicyRequest extends \Google\Protobuf\Internal\Message { /** - * Required. The project in which to create the alerting policy. The format is: + * 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. 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 + * policy will be written, not the name of the created policy. |name| must be + * a host project of a workspace, otherwise INVALID_ARGUMENT error will + * return. The alerting policy that is returned will have a name that contains + * a normalized representation of this name as a prefix but adds a suffix of + * the form `/alertPolicies/[ALERT_POLICY_ID]`, identifying the policy in the * container. * * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { @@ -44,13 +46,15 @@ class CreateAlertPolicyRequest extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $name - * Required. The project in which to create the alerting policy. The format is: + * 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. 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 + * policy will be written, not the name of the created policy. |name| must be + * a host project of a workspace, otherwise INVALID_ARGUMENT error will + * return. The alerting policy that is returned will have a name that contains + * a normalized representation of this name as a prefix but adds a suffix of + * the form `/alertPolicies/[ALERT_POLICY_ID]`, identifying the policy in the * container. * @type \Google\Cloud\Monitoring\V3\AlertPolicy $alert_policy * Required. The requested alerting policy. You should omit the `name` field in this @@ -64,13 +68,15 @@ public function __construct($data = NULL) { } /** - * Required. The project in which to create the alerting policy. The format is: + * 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. 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 + * policy will be written, not the name of the created policy. |name| must be + * a host project of a workspace, otherwise INVALID_ARGUMENT error will + * return. The alerting policy that is returned will have a name that contains + * a normalized representation of this name as a prefix but adds a suffix of + * the form `/alertPolicies/[ALERT_POLICY_ID]`, identifying the policy in the * container. * * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { @@ -82,13 +88,15 @@ public function getName() } /** - * Required. The project in which to create the alerting policy. The format is: + * 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. 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 + * policy will be written, not the name of the created policy. |name| must be + * a host project of a workspace, otherwise INVALID_ARGUMENT error will + * return. The alerting policy that is returned will have a name that contains + * a normalized representation of this name as a prefix but adds a suffix of + * the form `/alertPolicies/[ALERT_POLICY_ID]`, identifying the policy in the * container. * * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { @@ -109,13 +117,23 @@ public function setName($var) * 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 + * @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 diff --git a/Monitoring/src/V3/CreateGroupRequest.php b/Monitoring/src/V3/CreateGroupRequest.php index bb54d6e237f..91e79f540cb 100644 --- a/Monitoring/src/V3/CreateGroupRequest.php +++ b/Monitoring/src/V3/CreateGroupRequest.php @@ -16,7 +16,8 @@ class CreateGroupRequest extends \Google\Protobuf\Internal\Message { /** - * Required. The project 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) = { @@ -43,7 +44,8 @@ class CreateGroupRequest extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $name - * Required. The project 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 @@ -58,7 +60,8 @@ public function __construct($data = NULL) { } /** - * Required. The project 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) = { @@ -70,7 +73,8 @@ public function getName() } /** - * Required. The project 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) = { @@ -90,13 +94,23 @@ public function setName($var) * 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 + * @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. diff --git a/Monitoring/src/V3/CreateMetricDescriptorRequest.php b/Monitoring/src/V3/CreateMetricDescriptorRequest.php index 883543d1812..62c0ff860c3 100644 --- a/Monitoring/src/V3/CreateMetricDescriptorRequest.php +++ b/Monitoring/src/V3/CreateMetricDescriptorRequest.php @@ -16,7 +16,9 @@ class CreateMetricDescriptorRequest extends \Google\Protobuf\Internal\Message { /** - * Required. The project 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] * * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { @@ -37,7 +39,9 @@ class CreateMetricDescriptorRequest extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $name - * Required. The project 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) @@ -50,7 +54,9 @@ public function __construct($data = NULL) { } /** - * Required. The project 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] * * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { @@ -62,7 +68,9 @@ public function getName() } /** - * Required. The project 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] * * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { @@ -82,13 +90,23 @@ public function setName($var) * descriptor. * * Generated from protobuf field .google.api.MetricDescriptor metric_descriptor = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Api\MetricDescriptor + * @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. diff --git a/Monitoring/src/V3/CreateNotificationChannelRequest.php b/Monitoring/src/V3/CreateNotificationChannelRequest.php index c782956b315..7b8210a133a 100644 --- a/Monitoring/src/V3/CreateNotificationChannelRequest.php +++ b/Monitoring/src/V3/CreateNotificationChannelRequest.php @@ -16,7 +16,8 @@ class CreateNotificationChannelRequest extends \Google\Protobuf\Internal\Message { /** - * Required. The project 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] * This names the container into which the channel will be * written, this does not name the newly created channel. The resulting @@ -40,7 +41,8 @@ class CreateNotificationChannelRequest extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $name - * Required. The project 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] * This names the container into which the channel will be * written, this does not name the newly created channel. The resulting @@ -56,7 +58,8 @@ public function __construct($data = NULL) { } /** - * Required. The project 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] * This names the container into which the channel will be * written, this does not name the newly created channel. The resulting @@ -72,7 +75,8 @@ public function getName() } /** - * Required. The project 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] * This names the container into which the channel will be * written, this does not name the newly created channel. The resulting @@ -95,13 +99,23 @@ public function setName($var) * 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 + * @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. * diff --git a/Monitoring/src/V3/CreateServiceLevelObjectiveRequest.php b/Monitoring/src/V3/CreateServiceLevelObjectiveRequest.php index 17e232e77fb..54576771c14 100644 --- a/Monitoring/src/V3/CreateServiceLevelObjectiveRequest.php +++ b/Monitoring/src/V3/CreateServiceLevelObjectiveRequest.php @@ -127,13 +127,23 @@ public function setServiceLevelObjectiveId($var) * 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 + * @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 diff --git a/Monitoring/src/V3/CreateServiceRequest.php b/Monitoring/src/V3/CreateServiceRequest.php index a5d8a28564a..64941c442af 100644 --- a/Monitoring/src/V3/CreateServiceRequest.php +++ b/Monitoring/src/V3/CreateServiceRequest.php @@ -16,7 +16,8 @@ class CreateServiceRequest extends \Google\Protobuf\Internal\Message { /** - * Required. Resource name of the parent workspace. The format is: + * Required. Resource [name](https://cloud.google.com/monitoring/api/v3#project_name) of + * the parent workspace. The format is: * projects/[PROJECT_ID_OR_NUMBER] * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { @@ -43,7 +44,8 @@ class CreateServiceRequest extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $parent - * Required. Resource name of the parent workspace. The format is: + * Required. Resource [name](https://cloud.google.com/monitoring/api/v3#project_name) of + * the parent workspace. The format is: * projects/[PROJECT_ID_OR_NUMBER] * @type string $service_id * Optional. The Service id to use for this Service. If omitted, an id will be @@ -58,7 +60,8 @@ public function __construct($data = NULL) { } /** - * Required. Resource name of the parent workspace. The format is: + * Required. Resource [name](https://cloud.google.com/monitoring/api/v3#project_name) of + * the parent workspace. The format is: * projects/[PROJECT_ID_OR_NUMBER] * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { @@ -70,7 +73,8 @@ public function getParent() } /** - * Required. Resource name of the parent workspace. The format is: + * Required. Resource [name](https://cloud.google.com/monitoring/api/v3#project_name) of + * the parent workspace. The format is: * projects/[PROJECT_ID_OR_NUMBER] * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { @@ -117,13 +121,23 @@ public function setServiceId($var) * 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 + * @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. * diff --git a/Monitoring/src/V3/CreateTimeSeriesError.php b/Monitoring/src/V3/CreateTimeSeriesError.php index 2eb3a2ebab2..556d57d6608 100644 --- a/Monitoring/src/V3/CreateTimeSeriesError.php +++ b/Monitoring/src/V3/CreateTimeSeriesError.php @@ -19,14 +19,16 @@ 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 */ - private $time_series = null; + 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 */ - private $status = null; + protected $status = null; /** * Constructor. @@ -49,22 +51,38 @@ public function __construct($data = NULL) { * 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 + * @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; @@ -75,22 +93,38 @@ public function setTimeSeries($var) * 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 + * @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; diff --git a/Monitoring/src/V3/CreateTimeSeriesRequest.php b/Monitoring/src/V3/CreateTimeSeriesRequest.php index e0fcc158991..21f57467a90 100644 --- a/Monitoring/src/V3/CreateTimeSeriesRequest.php +++ b/Monitoring/src/V3/CreateTimeSeriesRequest.php @@ -16,7 +16,8 @@ class CreateTimeSeriesRequest extends \Google\Protobuf\Internal\Message { /** - * Required. The project 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) = { @@ -41,7 +42,8 @@ class CreateTimeSeriesRequest extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $name - * Required. The project 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 \Google\Cloud\Monitoring\V3\TimeSeries[]|\Google\Protobuf\Internal\RepeatedField $time_series * Required. The new data to be added to a list of time series. @@ -58,7 +60,8 @@ public function __construct($data = NULL) { } /** - * Required. The project 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) = { @@ -70,7 +73,8 @@ public function getName() } /** - * Required. The project 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/CreateTimeSeriesSummary/Error.php b/Monitoring/src/V3/CreateTimeSeriesSummary/Error.php index 4e8e43650e0..e0a196e5d67 100644 --- a/Monitoring/src/V3/CreateTimeSeriesSummary/Error.php +++ b/Monitoring/src/V3/CreateTimeSeriesSummary/Error.php @@ -49,13 +49,23 @@ public function __construct($data = NULL) { * The status of the requested write operation. * * Generated from protobuf field .google.rpc.Status status = 1; - * @return \Google\Rpc\Status + * @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. * diff --git a/Monitoring/src/V3/CreateUptimeCheckConfigRequest.php b/Monitoring/src/V3/CreateUptimeCheckConfigRequest.php index 4e379935aac..eb4b513fe88 100644 --- a/Monitoring/src/V3/CreateUptimeCheckConfigRequest.php +++ b/Monitoring/src/V3/CreateUptimeCheckConfigRequest.php @@ -16,7 +16,8 @@ class CreateUptimeCheckConfigRequest extends \Google\Protobuf\Internal\Message { /** - * Required. The project in which to create the Uptime check. The format is: + * 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) = { @@ -36,7 +37,8 @@ class CreateUptimeCheckConfigRequest extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $parent - * Required. The project in which to create the Uptime check. The format is: + * 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. @@ -48,7 +50,8 @@ public function __construct($data = NULL) { } /** - * Required. The project in which to create the Uptime check. The format is: + * 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) = { @@ -60,7 +63,8 @@ public function getParent() } /** - * Required. The project in which to create the Uptime check. The format is: + * 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) = { @@ -79,13 +83,23 @@ public function setParent($var) * 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 + * @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. * diff --git a/Monitoring/src/V3/DistributionCut.php b/Monitoring/src/V3/DistributionCut.php index f5cc9ad5c8b..422f173d600 100644 --- a/Monitoring/src/V3/DistributionCut.php +++ b/Monitoring/src/V3/DistributionCut.php @@ -12,8 +12,8 @@ * A `DistributionCut` defines a `TimeSeries` and thresholds used for measuring * good service and total service. The `TimeSeries` must have `ValueType = * DISTRIBUTION` and `MetricKind = DELTA` or `MetricKind = CUMULATIVE`. The - * computed `good_service` will be the count of values x in the `Distribution` - * such that `range.min <= x < range.max`. + * computed `good_service` will be the estimated count of values in the + * `Distribution` that fall within the specified `min` and `max`. * * Generated from protobuf message google.monitoring.v3.DistributionCut */ @@ -90,13 +90,23 @@ public function setDistributionFilter($var) * an infinite value. * * Generated from protobuf field .google.monitoring.v3.Range range = 5; - * @return \Google\Cloud\Monitoring\V3\Range + * @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. diff --git a/Monitoring/src/V3/DroppedLabels.php b/Monitoring/src/V3/DroppedLabels.php index cd7f1740d22..4fb73d3bdd7 100644 --- a/Monitoring/src/V3/DroppedLabels.php +++ b/Monitoring/src/V3/DroppedLabels.php @@ -9,15 +9,16 @@ use Google\Protobuf\Internal\GPBUtil; /** - * A set of (label, value) pairs which were dropped during aggregation, attached - * to google.api.Distribution.Exemplars in google.api.Distribution values during - * aggregation. - * These values are used in combination with the label values that remain on the - * aggregated Distribution timeseries to construct the full label set for the - * exemplar values. The resulting full label set may be used to identify the - * specific task/job/instance (for example) which may be contributing to a - * long-tail, while allowing the storage savings of only storing aggregated - * distribution values for a large group. + * A set of (label, value) pairs that were removed from a Distribution + * time series during aggregation and then added as an attachment to a + * Distribution.Exemplar. + * The full label set for the exemplars is constructed by using the dropped + * pairs in combination with the label values that remain on the aggregated + * Distribution time series. The constructed full label set can be used to + * identify the specific entity, such as the instance or job, which might be + * contributing to a long-tail. However, with dropped labels, the storage + * requirements are reduced because only the aggregated distribution values for + * a large group of time series are stored. * Note that there are no guarantees on ordering of the labels from * exemplar-to-exemplar and from distribution-to-distribution in the same * stream, and there may be duplicates. It is up to clients to resolve any diff --git a/Monitoring/src/V3/Gapic/AlertPolicyServiceGapicClient.php b/Monitoring/src/V3/Gapic/AlertPolicyServiceGapicClient.php index db5367d1a8a..4151cbae42b 100644 --- a/Monitoring/src/V3/Gapic/AlertPolicyServiceGapicClient.php +++ b/Monitoring/src/V3/Gapic/AlertPolicyServiceGapicClient.php @@ -17,9 +17,9 @@ /* * GENERATED CODE WARNING - * This file was generated from the file - * https://github.com/google/googleapis/blob/master/google/monitoring/v3/alert_service.proto - * and updates to that file get reflected here through a refresh process. + * Generated by gapic-generator-php from the file + * https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/alert_service.proto + * Updates to the above are reflected here through a refresh process. */ namespace Google\Cloud\Monitoring\V3\Gapic; @@ -27,6 +27,7 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; + use Google\ApiCore\PathTemplate; use Google\ApiCore\RequestParamsHeaderDescriptor; use Google\ApiCore\RetrySettings; @@ -60,32 +61,18 @@ * ``` * $alertPolicyServiceClient = new Google\Cloud\Monitoring\V3\AlertPolicyServiceClient(); * try { - * $formattedName = $alertPolicyServiceClient->projectName('[PROJECT]'); - * // Iterate over pages of elements - * $pagedResponse = $alertPolicyServiceClient->listAlertPolicies($formattedName); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * - * - * // Alternatively: - * - * // Iterate through all elements - * $pagedResponse = $alertPolicyServiceClient->listAlertPolicies($formattedName); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } + * $name = 'name'; + * $alertPolicy = new Google\Cloud\Monitoring\V3\AlertPolicy(); + * $response = $alertPolicyServiceClient->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. + * Many parameters require resource names to be formatted in a particular way. To + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. */ class AlertPolicyServiceGapicClient { @@ -118,27 +105,32 @@ class AlertPolicyServiceGapicClient '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 $alertPolicyNameTemplate; - private static $alertPolicyConditionNameTemplate; - private static $projectNameTemplate; + + private static $folderAlertPolicyNameTemplate; + + private static $organizationAlertPolicyNameTemplate; + + private static $projectAlertPolicyNameTemplate; + 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', + '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' => [ - 'scopes' => self::$serviceScopes, + 'defaultScopes' => self::$serviceScopes, ], 'transportConfig' => [ 'rest' => [ - 'restClientConfigPath' => __DIR__.'/../resources/alert_policy_service_rest_client_config.php', + 'restClientConfigPath' => __DIR__ . '/../resources/alert_policy_service_rest_client_config.php', ], ], ]; @@ -146,38 +138,48 @@ private static function getClientDefaults() private static function getAlertPolicyNameTemplate() { - if (null == self::$alertPolicyNameTemplate) { + if (self::$alertPolicyNameTemplate == null) { self::$alertPolicyNameTemplate = new PathTemplate('projects/{project}/alertPolicies/{alert_policy}'); } return self::$alertPolicyNameTemplate; } - private static function getAlertPolicyConditionNameTemplate() + private static function getFolderAlertPolicyNameTemplate() { - if (null == self::$alertPolicyConditionNameTemplate) { - self::$alertPolicyConditionNameTemplate = new PathTemplate('projects/{project}/alertPolicies/{alert_policy}/conditions/{condition}'); + if (self::$folderAlertPolicyNameTemplate == null) { + self::$folderAlertPolicyNameTemplate = new PathTemplate('folders/{folder}/alertPolicies/{alert_policy}'); } - return self::$alertPolicyConditionNameTemplate; + return self::$folderAlertPolicyNameTemplate; } - private static function getProjectNameTemplate() + private static function getOrganizationAlertPolicyNameTemplate() { - if (null == self::$projectNameTemplate) { - self::$projectNameTemplate = new PathTemplate('projects/{project}'); + if (self::$organizationAlertPolicyNameTemplate == null) { + self::$organizationAlertPolicyNameTemplate = new PathTemplate('organizations/{organization}/alertPolicies/{alert_policy}'); } - return self::$projectNameTemplate; + return self::$organizationAlertPolicyNameTemplate; + } + + private static function getProjectAlertPolicyNameTemplate() + { + if (self::$projectAlertPolicyNameTemplate == null) { + self::$projectAlertPolicyNameTemplate = new PathTemplate('projects/{project}/alertPolicies/{alert_policy}'); + } + + return self::$projectAlertPolicyNameTemplate; } private static function getPathTemplateMap() { - if (null == self::$pathTemplateMap) { + if (self::$pathTemplateMap == null) { self::$pathTemplateMap = [ 'alertPolicy' => self::getAlertPolicyNameTemplate(), - 'alertPolicyCondition' => self::getAlertPolicyConditionNameTemplate(), - 'project' => self::getProjectNameTemplate(), + 'folderAlertPolicy' => self::getFolderAlertPolicyNameTemplate(), + 'organizationAlertPolicy' => self::getOrganizationAlertPolicyNameTemplate(), + 'projectAlertPolicy' => self::getProjectAlertPolicyNameTemplate(), ]; } @@ -185,8 +187,8 @@ private static function getPathTemplateMap() } /** - * Formats a string containing the fully-qualified path to represent - * a alert_policy resource. + * Formats a string containing the fully-qualified path to represent a alert_policy + * resource. * * @param string $project * @param string $alertPolicy @@ -202,36 +204,53 @@ public static function alertPolicyName($project, $alertPolicy) } /** - * Formats a string containing the fully-qualified path to represent - * a alert_policy_condition resource. + * Formats a string containing the fully-qualified path to represent a + * folder_alert_policy resource. * - * @param string $project + * @param string $folder * @param string $alertPolicy - * @param string $condition * - * @return string The formatted alert_policy_condition resource. + * @return string The formatted folder_alert_policy resource. */ - public static function alertPolicyConditionName($project, $alertPolicy, $condition) + public static function folderAlertPolicyName($folder, $alertPolicy) { - return self::getAlertPolicyConditionNameTemplate()->render([ - 'project' => $project, + 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, - 'condition' => $condition, ]); } /** - * Formats a string containing the fully-qualified path to represent - * a project resource. + * 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 resource. + * @return string The formatted project_alert_policy resource. */ - public static function projectName($project) + public static function projectAlertPolicyName($project, $alertPolicy) { - return self::getProjectNameTemplate()->render([ + return self::getProjectAlertPolicyNameTemplate()->render([ 'project' => $project, + 'alert_policy' => $alertPolicy, ]); } @@ -240,13 +259,15 @@ public static function projectName($project) * The following name formats are supported: * Template: Pattern * - alertPolicy: projects/{project}/alertPolicies/{alert_policy} - * - alertPolicyCondition: projects/{project}/alertPolicies/{alert_policy}/conditions/{condition} - * - project: projects/{project}. + * - folderAlertPolicy: folders/{folder}/alertPolicies/{alert_policy} + * - organizationAlertPolicy: organizations/{organization}/alertPolicies/{alert_policy} + * - projectAlertPolicy: projects/{project}/alertPolicies/{alert_policy} * - * The optional $template argument can be supplied to specify a particular pattern, and must - * match one of the templates listed above. If no $template argument is provided, or if the - * $template argument does not match one of the templates listed, then parseName will check - * each of the supported templates, and return the first match. + * 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 @@ -258,7 +279,6 @@ public static function projectName($project) 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"); @@ -274,6 +294,7 @@ public static function parseName($formattedName, $template = null) // Swallow the exception to continue trying other path templates } } + throw new ValidationException("Input did not match any known format. Input: $formattedName"); } @@ -281,7 +302,7 @@ public static function parseName($formattedName, $template = null) * Constructor. * * @param array $options { - * Optional. Options for configuring the service API wrapper. + * Optional. Options for configuring the service API wrapper. * * @type string $serviceAddress * **Deprecated**. This option will be removed in a future major release. Please @@ -298,35 +319,38 @@ public static function parseName($formattedName, $template = null) * {@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()}. + * 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. + * 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. + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $serviceAddress setting, will be ignored. * @type array $transportConfig * Configuration options that will be used to construct the transport. Options for * each supported transport type should be passed in a key for that transport. For * example: * $transportConfig = [ * 'grpc' => [...], - * 'rest' => [...] + * '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 @@ -338,274 +362,242 @@ public function __construct(array $options = []) } /** - * Lists the existing alerting policies for the project. + * Creates a new alerting policy. * * Sample code: * ``` * $alertPolicyServiceClient = new Google\Cloud\Monitoring\V3\AlertPolicyServiceClient(); * try { - * $formattedName = $alertPolicyServiceClient->projectName('[PROJECT]'); - * // Iterate over pages of elements - * $pagedResponse = $alertPolicyServiceClient->listAlertPolicies($formattedName); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * - * - * // Alternatively: - * - * // Iterate through all elements - * $pagedResponse = $alertPolicyServiceClient->listAlertPolicies($formattedName); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } + * $name = 'name'; + * $alertPolicy = new Google\Cloud\Monitoring\V3\AlertPolicy(); + * $response = $alertPolicyServiceClient->createAlertPolicy($name, $alertPolicy); * } finally { * $alertPolicyServiceClient->close(); * } * ``` * - * @param string $name Required. The project whose alert policies are to be listed. The format is: + * @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] + * 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. + * Note that this field names the parent container in which the alerting + * policy will be written, not the name of the created policy. |name| must be + * a host project of a workspace, otherwise INVALID_ARGUMENT error will + * return. The alerting policy that is returned will have a name that contains + * a normalized representation of this name as a prefix but adds a suffix of + * the form `/alertPolicies/[ALERT_POLICY_ID]`, identifying the policy in the + * container. + * @param AlertPolicy $alertPolicy Required. The requested alerting policy. You should omit the `name` field in this + * policy. The name will be returned in the new policy, including + * a new `[ALERT_POLICY_ID]` value. + * @param array $optionalArgs { + * Optional. * - * For more details, see [sorting and - * filtering](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering). - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * - * @return \Google\ApiCore\PagedListResponse + * @return \Google\Cloud\Monitoring\V3\AlertPolicy * * @throws ApiException if the remote call fails */ - public function listAlertPolicies($name, array $optionalArgs = []) + public function createAlertPolicy($name, $alertPolicy, array $optionalArgs = []) { - $request = new ListAlertPoliciesRequest(); + $request = new CreateAlertPolicyRequest(); + $requestParamHeaders = []; $request->setName($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([ - 'name' => $request->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->getPagedListResponse( - 'ListAlertPolicies', - $optionalArgs, - ListAlertPoliciesResponse::class, - $request - ); + $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(); } /** - * Gets a single alerting policy. + * Deletes an alerting policy. * * Sample code: * ``` * $alertPolicyServiceClient = new Google\Cloud\Monitoring\V3\AlertPolicyServiceClient(); * try { * $formattedName = $alertPolicyServiceClient->alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); - * $response = $alertPolicyServiceClient->getAlertPolicy($formattedName); + * $alertPolicyServiceClient->deleteAlertPolicy($formattedName); * } finally { * $alertPolicyServiceClient->close(); * } * ``` * - * @param string $name Required. The alerting policy to retrieve. The format is: + * @param string $name Required. The alerting policy to delete. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] * - * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] - * @param array $optionalArgs { - * Optional. + * For more information, see [AlertPolicy][google.monitoring.v3.AlertPolicy]. + * @param array $optionalArgs { + * Optional. * * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * - * @return \Google\Cloud\Monitoring\V3\AlertPolicy - * * @throws ApiException if the remote call fails */ - public function getAlertPolicy($name, array $optionalArgs = []) + public function deleteAlertPolicy($name, array $optionalArgs = []) { - $request = new GetAlertPolicyRequest(); + $request = new DeleteAlertPolicyRequest(); + $requestParamHeaders = []; $request->setName($name); - - $requestParams = new RequestParamsHeaderDescriptor([ - 'name' => $request->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'GetAlertPolicy', - AlertPolicy::class, - $optionalArgs, - $request - )->wait(); + $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(); } /** - * Creates a new alerting policy. + * Gets a single alerting policy. * * Sample code: * ``` * $alertPolicyServiceClient = new Google\Cloud\Monitoring\V3\AlertPolicyServiceClient(); * try { - * $formattedName = $alertPolicyServiceClient->projectName('[PROJECT]'); - * $alertPolicy = new Google\Cloud\Monitoring\V3\AlertPolicy(); - * $response = $alertPolicyServiceClient->createAlertPolicy($formattedName, $alertPolicy); + * $formattedName = $alertPolicyServiceClient->alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); + * $response = $alertPolicyServiceClient->getAlertPolicy($formattedName); * } finally { * $alertPolicyServiceClient->close(); * } * ``` * - * @param string $name Required. The project in which to create the alerting policy. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER] + * @param string $name Required. The alerting policy to retrieve. The format is: * - * Note that this field names the parent container in which the alerting - * policy will be written, not the name of the created policy. 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. + * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] + * @param array $optionalArgs { + * Optional. * * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * * @return \Google\Cloud\Monitoring\V3\AlertPolicy * * @throws ApiException if the remote call fails */ - public function createAlertPolicy($name, $alertPolicy, array $optionalArgs = []) + public function getAlertPolicy($name, array $optionalArgs = []) { - $request = new CreateAlertPolicyRequest(); + $request = new GetAlertPolicyRequest(); + $requestParamHeaders = []; $request->setName($name); - $request->setAlertPolicy($alertPolicy); - - $requestParams = new RequestParamsHeaderDescriptor([ - 'name' => $request->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'CreateAlertPolicy', - AlertPolicy::class, - $optionalArgs, - $request - )->wait(); + $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(); } /** - * Deletes an alerting policy. + * Lists the existing alerting policies for the workspace. * * Sample code: * ``` * $alertPolicyServiceClient = new Google\Cloud\Monitoring\V3\AlertPolicyServiceClient(); * try { - * $formattedName = $alertPolicyServiceClient->alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); - * $alertPolicyServiceClient->deleteAlertPolicy($formattedName); + * $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 alerting policy to delete. The format is: + * @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]/alertPolicies/[ALERT_POLICY_ID] + * projects/[PROJECT_ID_OR_NUMBER] * - * For more information, see [AlertPolicy][google.monitoring.v3.AlertPolicy]. - * @param array $optionalArgs { - * Optional. + * Note that this field names the parent container in which the alerting + * policies to be listed are stored. To retrieve a single alerting policy + * by name, use the + * [GetAlertPolicy][google.monitoring.v3.AlertPolicyService.GetAlertPolicy] + * operation, instead. + * @param array $optionalArgs { + * Optional. + * + * @type string $filter + * If provided, this field specifies the criteria that must be met by + * alert policies to be included in the response. * + * For more details, see [sorting and + * filtering](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering). + * @type string $orderBy + * A comma-separated list of fields by which to sort the result. Supports + * the same set of field references as the `filter` field. Entries can be + * prefixed with a minus sign to sort by the field in descending order. + * + * For more details, see [sorting and + * filtering](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering). + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * + * @return \Google\ApiCore\PagedListResponse + * * @throws ApiException if the remote call fails */ - public function deleteAlertPolicy($name, array $optionalArgs = []) + public function listAlertPolicies($name, array $optionalArgs = []) { - $request = new DeleteAlertPolicyRequest(); + $request = new ListAlertPoliciesRequest(); + $requestParamHeaders = []; $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } - $requestParams = new RequestParamsHeaderDescriptor([ - 'name' => $request->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'DeleteAlertPolicy', - GPBEmpty::class, - $optionalArgs, - $request - )->wait(); + 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); } /** @@ -630,35 +622,35 @@ public function deleteAlertPolicy($name, array $optionalArgs = []) * If `update_mask` is not empty, any fields in this policy that are * not in `update_mask` are ignored. * @param array $optionalArgs { - * Optional. + * 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. + * Optional. A list of alerting policy field names. If this field is not + * empty, each listed field in the existing alerting policy is set to the + * value of the corresponding field in the supplied policy (`alert_policy`), + * or to the field's default value if the field is not in the supplied + * alerting policy. Fields not listed retain their previous value. + * + * Examples of valid field masks include `display_name`, `documentation`, + * `documentation.content`, `documentation.mime_type`, `user_labels`, + * `user_label.nameofkey`, `enabled`, `conditions`, `combiner`, etc. + * + * If this field is empty, then the supplied alerting policy replaces the + * existing policy. It is the same as deleting the existing policy and + * adding the supplied policy, except for the following: + * + * + The new policy will have the same `[ALERT_POLICY_ID]` as the former + * policy. This gives you continuity with the former policy in your + * notifications and incidents. + * + Conditions in the new policy will keep their former `[CONDITION_ID]` if + * the supplied condition includes the `name` field with that + * `[CONDITION_ID]`. If the supplied condition omits the `name` field, + * then a new `[CONDITION_ID]` is created. * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * * @return \Google\Cloud\Monitoring\V3\AlertPolicy @@ -668,23 +660,15 @@ public function deleteAlertPolicy($name, array $optionalArgs = []) 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([ - 'alert_policy.name' => $request->getAlertPolicy()->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'UpdateAlertPolicy', - AlertPolicy::class, - $optionalArgs, - $request - )->wait(); + $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/Monitoring/src/V3/Gapic/GroupServiceGapicClient.php b/Monitoring/src/V3/Gapic/GroupServiceGapicClient.php index aefe83a01b2..833d05df9d7 100644 --- a/Monitoring/src/V3/Gapic/GroupServiceGapicClient.php +++ b/Monitoring/src/V3/Gapic/GroupServiceGapicClient.php @@ -17,9 +17,9 @@ /* * GENERATED CODE WARNING - * This file was generated from the file - * https://github.com/google/googleapis/blob/master/google/monitoring/v3/group_service.proto - * and updates to that file get reflected here through a refresh process. + * Generated by gapic-generator-php from the file + * https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/group_service.proto + * Updates to the above are reflected here through a refresh process. */ namespace Google\Cloud\Monitoring\V3\Gapic; @@ -27,6 +27,7 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; + use Google\ApiCore\PathTemplate; use Google\ApiCore\RequestParamsHeaderDescriptor; use Google\ApiCore\RetrySettings; @@ -47,7 +48,7 @@ /** * Service Description: The Group API lets you inspect and manage your - * [groups](https://cloud.google.com#google.monitoring.v3.Group). + * [groups](#google.monitoring.v3.Group). * * A group is a named filter that is used to identify * a collection of monitored resources. Groups are typically used to @@ -65,32 +66,18 @@ * ``` * $groupServiceClient = new Google\Cloud\Monitoring\V3\GroupServiceClient(); * try { - * $formattedName = $groupServiceClient->projectName('[PROJECT]'); - * // Iterate over pages of elements - * $pagedResponse = $groupServiceClient->listGroups($formattedName); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * - * - * // Alternatively: - * - * // Iterate through all elements - * $pagedResponse = $groupServiceClient->listGroups($formattedName); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } + * $name = 'name'; + * $group = new Google\Cloud\Monitoring\V3\Group(); + * $response = $groupServiceClient->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. + * Many parameters require resource names to be formatted in a particular way. To + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. */ class GroupServiceGapicClient { @@ -123,55 +110,81 @@ class GroupServiceGapicClient '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 $folderGroupNameTemplate; + private static $groupNameTemplate; - private static $projectNameTemplate; + + 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', + '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' => [ - 'scopes' => self::$serviceScopes, + 'defaultScopes' => self::$serviceScopes, ], 'transportConfig' => [ 'rest' => [ - 'restClientConfigPath' => __DIR__.'/../resources/group_service_rest_client_config.php', + '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 (null == self::$groupNameTemplate) { + if (self::$groupNameTemplate == null) { self::$groupNameTemplate = new PathTemplate('projects/{project}/groups/{group}'); } return self::$groupNameTemplate; } - private static function getProjectNameTemplate() + private static function getOrganizationGroupNameTemplate() + { + if (self::$organizationGroupNameTemplate == null) { + self::$organizationGroupNameTemplate = new PathTemplate('organizations/{organization}/groups/{group}'); + } + + return self::$organizationGroupNameTemplate; + } + + private static function getProjectGroupNameTemplate() { - if (null == self::$projectNameTemplate) { - self::$projectNameTemplate = new PathTemplate('projects/{project}'); + if (self::$projectGroupNameTemplate == null) { + self::$projectGroupNameTemplate = new PathTemplate('projects/{project}/groups/{group}'); } - return self::$projectNameTemplate; + return self::$projectGroupNameTemplate; } private static function getPathTemplateMap() { - if (null == self::$pathTemplateMap) { + if (self::$pathTemplateMap == null) { self::$pathTemplateMap = [ + 'folderGroup' => self::getFolderGroupNameTemplate(), 'group' => self::getGroupNameTemplate(), - 'project' => self::getProjectNameTemplate(), + 'organizationGroup' => self::getOrganizationGroupNameTemplate(), + 'projectGroup' => self::getProjectGroupNameTemplate(), ]; } @@ -179,8 +192,25 @@ private static function getPathTemplateMap() } /** - * Formats a string containing the fully-qualified path to represent - * a group resource. + * 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 @@ -196,17 +226,36 @@ public static function groupName($project, $group) } /** - * Formats a string containing the fully-qualified path to represent - * a project resource. + * 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 resource. + * @return string The formatted project_group resource. */ - public static function projectName($project) + public static function projectGroupName($project, $group) { - return self::getProjectNameTemplate()->render([ + return self::getProjectGroupNameTemplate()->render([ 'project' => $project, + 'group' => $group, ]); } @@ -214,13 +263,16 @@ public static function projectName($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 + * - folderGroup: folders/{folder}/groups/{group} * - group: projects/{project}/groups/{group} - * - project: projects/{project}. + * - 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. + * 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 @@ -232,7 +284,6 @@ public static function projectName($project) 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"); @@ -248,6 +299,7 @@ public static function parseName($formattedName, $template = null) // Swallow the exception to continue trying other path templates } } + throw new ValidationException("Input did not match any known format. Input: $formattedName"); } @@ -255,7 +307,7 @@ public static function parseName($formattedName, $template = null) * Constructor. * * @param array $options { - * Optional. Options for configuring the service API wrapper. + * Optional. Options for configuring the service API wrapper. * * @type string $serviceAddress * **Deprecated**. This option will be removed in a future major release. Please @@ -272,35 +324,38 @@ public static function parseName($formattedName, $template = null) * {@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()}. + * 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. + * 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. + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $serviceAddress setting, will be ignored. * @type array $transportConfig * Configuration options that will be used to construct the transport. Options for * each supported transport type should be passed in a key for that transport. For * example: * $transportConfig = [ * 'grpc' => [...], - * 'rest' => [...] + * '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 @@ -312,363 +367,259 @@ public function __construct(array $options = []) } /** - * Lists the existing groups. + * Creates a new group. * * Sample code: * ``` * $groupServiceClient = new Google\Cloud\Monitoring\V3\GroupServiceClient(); * try { - * $formattedName = $groupServiceClient->projectName('[PROJECT]'); - * // Iterate over pages of elements - * $pagedResponse = $groupServiceClient->listGroups($formattedName); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * - * - * // Alternatively: - * - * // Iterate through all elements - * $pagedResponse = $groupServiceClient->listGroups($formattedName); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } + * $name = 'name'; + * $group = new Google\Cloud\Monitoring\V3\Group(); + * $response = $groupServiceClient->createGroup($name, $group); * } finally { * $groupServiceClient->close(); * } * ``` * - * @param string $name Required. The project 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: + * @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]/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] + * @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. * - * 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 bool $validateOnly + * If true, validate this request but do not create the group. * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * - * @return \Google\ApiCore\PagedListResponse + * @return \Google\Cloud\Monitoring\V3\Group * * @throws ApiException if the remote call fails */ - public function listGroups($name, array $optionalArgs = []) + public function createGroup($name, $group, array $optionalArgs = []) { - $request = new ListGroupsRequest(); + $request = new CreateGroupRequest(); + $requestParamHeaders = []; $request->setName($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']); + $request->setGroup($group); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); } - $requestParams = new RequestParamsHeaderDescriptor([ - 'name' => $request->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->getPagedListResponse( - 'ListGroups', - $optionalArgs, - ListGroupsResponse::class, - $request - ); + $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(); } /** - * Gets a single group. + * Deletes an existing group. * * Sample code: * ``` * $groupServiceClient = new Google\Cloud\Monitoring\V3\GroupServiceClient(); * try { * $formattedName = $groupServiceClient->groupName('[PROJECT]', '[GROUP]'); - * $response = $groupServiceClient->getGroup($formattedName); + * $groupServiceClient->deleteGroup($formattedName); * } finally { * $groupServiceClient->close(); * } * ``` * - * @param string $name Required. The group to retrieve. The format is: + * @param string $name Required. The group to delete. The format is: * - * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] - * @param array $optionalArgs { - * Optional. + * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + * @param array $optionalArgs { + * Optional. * + * @type bool $recursive + * If this field is true, then the request means to delete a group with all + * its descendants. Otherwise, the request means to delete a group only when + * it has no descendants. The default value is false. * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * - * @return \Google\Cloud\Monitoring\V3\Group - * * @throws ApiException if the remote call fails */ - public function getGroup($name, array $optionalArgs = []) + public function deleteGroup($name, array $optionalArgs = []) { - $request = new GetGroupRequest(); + $request = new DeleteGroupRequest(); + $requestParamHeaders = []; $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['recursive'])) { + $request->setRecursive($optionalArgs['recursive']); + } - $requestParams = new RequestParamsHeaderDescriptor([ - 'name' => $request->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'GetGroup', - Group::class, - $optionalArgs, - $request - )->wait(); + $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(); } /** - * Creates a new group. + * Gets a single group. * * Sample code: * ``` * $groupServiceClient = new Google\Cloud\Monitoring\V3\GroupServiceClient(); * try { - * $formattedName = $groupServiceClient->projectName('[PROJECT]'); - * $group = new Google\Cloud\Monitoring\V3\Group(); - * $response = $groupServiceClient->createGroup($formattedName, $group); + * $formattedName = $groupServiceClient->groupName('[PROJECT]', '[GROUP]'); + * $response = $groupServiceClient->getGroup($formattedName); * } finally { * $groupServiceClient->close(); * } * ``` * - * @param string $name Required. The project in which to create the group. The format is: + * @param string $name Required. The group to retrieve. 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. + * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + * @param array $optionalArgs { + * Optional. * - * @type bool $validateOnly - * If true, validate this request but do not create the group. * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * * @return \Google\Cloud\Monitoring\V3\Group * * @throws ApiException if the remote call fails */ - public function createGroup($name, $group, array $optionalArgs = []) + public function getGroup($name, array $optionalArgs = []) { - $request = new CreateGroupRequest(); + $request = new GetGroupRequest(); + $requestParamHeaders = []; $request->setName($name); - $request->setGroup($group); - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor([ - 'name' => $request->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'CreateGroup', - Group::class, - $optionalArgs, - $request - )->wait(); + $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(); } /** - * Updates an existing group. - * You can change any group attributes except `name`. + * Lists the monitored resources that are members of a group. * * Sample code: * ``` * $groupServiceClient = new Google\Cloud\Monitoring\V3\GroupServiceClient(); * try { - * $group = new Google\Cloud\Monitoring\V3\Group(); - * $response = $groupServiceClient->updateGroup($group); + * $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 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. + * @param string $name Required. The group whose members are listed. The format is: * - * @type bool $validateOnly - * If true, validate this request but do not update the existing group. + * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type string $filter + * An optional [list + * filter](https://cloud.google.com/monitoring/api/learn_more#filtering) + * describing the members to be returned. The filter may reference the type, + * labels, and metadata of monitored resources that comprise the group. For + * example, to return only resources representing Compute Engine VM instances, + * use this filter: + * + * `resource.type = "gce_instance"` + * @type TimeInterval $interval + * An optional time interval for which results should be returned. Only + * members that were part of the group during the specified interval are + * included in the response. If no interval is provided then the group + * membership over the last minute is returned. * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * - * @return \Google\Cloud\Monitoring\V3\Group + * @return \Google\ApiCore\PagedListResponse * * @throws ApiException if the remote call fails */ - public function updateGroup($group, array $optionalArgs = []) + public function listGroupMembers($name, array $optionalArgs = []) { - $request = new UpdateGroupRequest(); - $request->setGroup($group); - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); + $request = new ListGroupMembersRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); } - $requestParams = new RequestParamsHeaderDescriptor([ - 'group.name' => $request->getGroup()->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'UpdateGroup', - Group::class, - $optionalArgs, - $request - )->wait(); - } + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } - /** - * Deletes an existing group. - * - * Sample code: - * ``` - * $groupServiceClient = new Google\Cloud\Monitoring\V3\GroupServiceClient(); - * try { - * $formattedName = $groupServiceClient->groupName('[PROJECT]', '[GROUP]'); - * $groupServiceClient->deleteGroup($formattedName); - * } finally { - * $groupServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The group to delete. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] - * @param array $optionalArgs { - * Optional. - * - * @type bool $recursive - * If this field is true, then the request means to delete a group with all - * its descendants. Otherwise, the request means to delete a group only when - * it has no descendants. The default value is false. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - */ - public function deleteGroup($name, array $optionalArgs = []) - { - $request = new DeleteGroupRequest(); - $request->setName($name); - if (isset($optionalArgs['recursive'])) { - $request->setRecursive($optionalArgs['recursive']); + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); } - $requestParams = new RequestParamsHeaderDescriptor([ - 'name' => $request->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'DeleteGroup', - GPBEmpty::class, - $optionalArgs, - $request - )->wait(); + 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 monitored resources that are members of a group. + * Lists the existing groups. * * Sample code: * ``` * $groupServiceClient = new Google\Cloud\Monitoring\V3\GroupServiceClient(); * try { - * $formattedName = $groupServiceClient->groupName('[PROJECT]', '[GROUP]'); + * $name = 'name'; * // Iterate over pages of elements - * $pagedResponse = $groupServiceClient->listGroupMembers($formattedName); + * $pagedResponse = $groupServiceClient->listGroups($name); * foreach ($pagedResponse->iteratePages() as $page) { * foreach ($page as $element) { * // doSomethingWith($element); * } * } - * - * * // Alternatively: - * * // Iterate through all elements - * $pagedResponse = $groupServiceClient->listGroupMembers($formattedName); + * $pagedResponse = $groupServiceClient->listGroups($name); * foreach ($pagedResponse->iterateAllElements() as $element) { * // doSomethingWith($element); * } @@ -677,75 +628,133 @@ public function deleteGroup($name, array $optionalArgs = []) * } * ``` * - * @param string $name Required. The group whose members are 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]/groups/[GROUP_ID] - * @param array $optionalArgs { - * Optional. + * 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. + * 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. + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * * @return \Google\ApiCore\PagedListResponse * * @throws ApiException if the remote call fails */ - public function listGroupMembers($name, array $optionalArgs = []) + public function listGroups($name, array $optionalArgs = []) { - $request = new ListGroupMembersRequest(); + $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']); } - 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('ListGroups', $optionalArgs, ListGroupsResponse::class, $request); + } + + /** + * Updates an existing group. + * You can change any group attributes except `name`. + * + * Sample code: + * ``` + * $groupServiceClient = new Google\Cloud\Monitoring\V3\GroupServiceClient(); + * try { + * $group = new Google\Cloud\Monitoring\V3\Group(); + * $response = $groupServiceClient->updateGroup($group); + * } finally { + * $groupServiceClient->close(); + * } + * ``` + * + * @param Group $group Required. The new definition of the group. All fields of the existing group, + * excepting `name`, are replaced with the corresponding fields of this group. + * @param array $optionalArgs { + * Optional. + * + * @type bool $validateOnly + * If true, validate this request but do not update the existing group. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Monitoring\V3\Group + * + * @throws ApiException if the remote call fails + */ + public function updateGroup($group, array $optionalArgs = []) + { + $request = new UpdateGroupRequest(); + $requestParamHeaders = []; + $request->setGroup($group); + $requestParamHeaders['group.name'] = $group->getName(); + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); } - $requestParams = new RequestParamsHeaderDescriptor([ - 'name' => $request->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->getPagedListResponse( - 'ListGroupMembers', - $optionalArgs, - ListGroupMembersResponse::class, - $request - ); + $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/Monitoring/src/V3/Gapic/MetricServiceGapicClient.php b/Monitoring/src/V3/Gapic/MetricServiceGapicClient.php index a70b8f9434c..222eac37a17 100644 --- a/Monitoring/src/V3/Gapic/MetricServiceGapicClient.php +++ b/Monitoring/src/V3/Gapic/MetricServiceGapicClient.php @@ -17,14 +17,17 @@ /* * GENERATED CODE WARNING - * This file was generated from the file - * https://github.com/google/googleapis/blob/master/google/monitoring/v3/metric_service.proto - * and updates to that file get reflected here through a refresh process. + * Generated by gapic-generator-php from the file + * https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/metric_service.proto + * Updates to the above are reflected here through a refresh process. */ namespace Google\Cloud\Monitoring\V3\Gapic; use Google\ApiCore\ApiException; +use Google\Api\MetricDescriptor; +use Google\Api\MonitoredResourceDescriptor; + use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; use Google\ApiCore\PathTemplate; @@ -32,8 +35,6 @@ use Google\ApiCore\RetrySettings; use Google\ApiCore\Transport\TransportInterface; use Google\ApiCore\ValidationException; -use Google\Api\MetricDescriptor; -use Google\Api\MonitoredResourceDescriptor; use Google\Auth\FetchAuthTokenInterface; use Google\Cloud\Monitoring\V3\Aggregation; use Google\Cloud\Monitoring\V3\CreateMetricDescriptorRequest; @@ -62,32 +63,18 @@ * ``` * $metricServiceClient = new Google\Cloud\Monitoring\V3\MetricServiceClient(); * try { - * $formattedName = $metricServiceClient->projectName('[PROJECT]'); - * // Iterate over pages of elements - * $pagedResponse = $metricServiceClient->listMonitoredResourceDescriptors($formattedName); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * - * - * // Alternatively: - * - * // Iterate through all elements - * $pagedResponse = $metricServiceClient->listMonitoredResourceDescriptors($formattedName); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } + * $name = 'name'; + * $metricDescriptor = new Google\Cloud\Monitoring\V3\MetricDescriptor(); + * $response = $metricServiceClient->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. + * Many parameters require resource names to be formatted in a particular way. To + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. */ class MetricServiceGapicClient { @@ -122,33 +109,82 @@ class MetricServiceGapicClient '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', + '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' => [ - 'scopes' => self::$serviceScopes, + 'defaultScopes' => self::$serviceScopes, ], 'transportConfig' => [ 'rest' => [ - 'restClientConfigPath' => __DIR__.'/../resources/metric_service_rest_client_config.php', + '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 (null == self::$metricDescriptorNameTemplate) { + if (self::$metricDescriptorNameTemplate == null) { self::$metricDescriptorNameTemplate = new PathTemplate('projects/{project}/metricDescriptors/{metric_descriptor=**}'); } @@ -157,29 +193,92 @@ private static function getMetricDescriptorNameTemplate() private static function getMonitoredResourceDescriptorNameTemplate() { - if (null == self::$monitoredResourceDescriptorNameTemplate) { + 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 (null == self::$projectNameTemplate) { + 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 (null == self::$pathTemplateMap) { + 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(), ]; } @@ -187,8 +286,57 @@ private static function getPathTemplateMap() } /** - * Formats a string containing the fully-qualified path to represent - * a metric_descriptor resource. + * 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 @@ -204,8 +352,8 @@ public static function metricDescriptorName($project, $metricDescriptor) } /** - * Formats a string containing the fully-qualified path to represent - * a monitored_resource_descriptor resource. + * Formats a string containing the fully-qualified path to represent a + * monitored_resource_descriptor resource. * * @param string $project * @param string $monitoredResourceDescriptor @@ -221,8 +369,57 @@ public static function monitoredResourceDescriptorName($project, $monitoredResou } /** - * Formats a string containing the fully-qualified path to represent - * a project resource. + * 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 * @@ -235,18 +432,77 @@ public static function projectName($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} - * - project: 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. + * - 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 @@ -258,7 +514,6 @@ public static function projectName($project) 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"); @@ -274,6 +529,7 @@ public static function parseName($formattedName, $template = null) // Swallow the exception to continue trying other path templates } } + throw new ValidationException("Input did not match any known format. Input: $formattedName"); } @@ -281,7 +537,7 @@ public static function parseName($formattedName, $template = null) * Constructor. * * @param array $options { - * Optional. Options for configuring the service API wrapper. + * Optional. Options for configuring the service API wrapper. * * @type string $serviceAddress * **Deprecated**. This option will be removed in a future major release. Please @@ -298,35 +554,38 @@ public static function parseName($formattedName, $template = null) * {@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()}. + * 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. + * 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. + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $serviceAddress setting, will be ignored. * @type array $transportConfig * Configuration options that will be used to construct the transport. Options for * each supported transport type should be passed in a key for that transport. For * example: * $transportConfig = [ * 'grpc' => [...], - * 'rest' => [...] + * '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 @@ -338,241 +597,210 @@ public function __construct(array $options = []) } /** - * Lists monitored resource descriptors that match a filter. This method does not require a Workspace. + * Creates a new metric descriptor. + * The creation is executed asynchronously and callers may check the returned + * operation to track its progress. + * User-created metric descriptors define + * [custom metrics](https://cloud.google.com/monitoring/custom-metrics). * * Sample code: * ``` * $metricServiceClient = new Google\Cloud\Monitoring\V3\MetricServiceClient(); * try { - * $formattedName = $metricServiceClient->projectName('[PROJECT]'); - * // Iterate over pages of elements - * $pagedResponse = $metricServiceClient->listMonitoredResourceDescriptors($formattedName); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * - * - * // Alternatively: - * - * // Iterate through all elements - * $pagedResponse = $metricServiceClient->listMonitoredResourceDescriptors($formattedName); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } + * $name = 'name'; + * $metricDescriptor = new Google\Cloud\Monitoring\V3\MetricDescriptor(); + * $response = $metricServiceClient->createMetricDescriptor($name, $metricDescriptor); * } finally { * $metricServiceClient->close(); * } * ``` * - * @param string $name Required. The project 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: + * @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. * - * resource.type = starts_with("gce_") AND resource.label:id - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * - * @return \Google\ApiCore\PagedListResponse + * @return \Google\Api\MetricDescriptor * * @throws ApiException if the remote call fails */ - public function listMonitoredResourceDescriptors($name, array $optionalArgs = []) + public function createMetricDescriptor($name, $metricDescriptor, array $optionalArgs = []) { - $request = new ListMonitoredResourceDescriptorsRequest(); + $request = new CreateMetricDescriptorRequest(); + $requestParamHeaders = []; $request->setName($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([ - 'name' => $request->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->getPagedListResponse( - 'ListMonitoredResourceDescriptors', - $optionalArgs, - ListMonitoredResourceDescriptorsResponse::class, - $request - ); + $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(); } /** - * Gets a single monitored resource descriptor. This method does not require a Workspace. + * 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 Google\Cloud\Monitoring\V3\MetricServiceClient(); * try { - * $formattedName = $metricServiceClient->monitoredResourceDescriptorName('[PROJECT]', '[MONITORED_RESOURCE_DESCRIPTOR]'); - * $response = $metricServiceClient->getMonitoredResourceDescriptor($formattedName); + * $formattedName = $metricServiceClient->projectName('[PROJECT]'); + * $timeSeries = []; + * $metricServiceClient->createServiceTimeSeries($formattedName, $timeSeries); * } finally { * $metricServiceClient->close(); * } * ``` * - * @param string $name Required. The monitored resource descriptor to get. 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]/monitoredResourceDescriptors/[RESOURCE_TYPE] + * 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 `[RESOURCE_TYPE]` is a predefined type, such as - * `cloudsql_database`. - * @param array $optionalArgs { - * Optional. + * The maximum number of `TimeSeries` objects per `Create` request is 200. + * @param array $optionalArgs { + * Optional. * * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * - * @return \Google\Api\MonitoredResourceDescriptor - * * @throws ApiException if the remote call fails */ - public function getMonitoredResourceDescriptor($name, array $optionalArgs = []) + public function createServiceTimeSeries($name, $timeSeries, array $optionalArgs = []) { - $request = new GetMonitoredResourceDescriptorRequest(); + $request = new CreateTimeSeriesRequest(); + $requestParamHeaders = []; $request->setName($name); - - $requestParams = new RequestParamsHeaderDescriptor([ - 'name' => $request->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'GetMonitoredResourceDescriptor', - MonitoredResourceDescriptor::class, - $optionalArgs, - $request - )->wait(); + $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(); } /** - * Lists metric descriptors that match a filter. This method does not require a Workspace. + * Creates or adds data to one or more time series. + * The response is empty if all time series in the request were written. + * If any time series could not be written, a corresponding failure message is + * included in the error response. * * Sample code: * ``` * $metricServiceClient = new Google\Cloud\Monitoring\V3\MetricServiceClient(); * try { * $formattedName = $metricServiceClient->projectName('[PROJECT]'); - * // Iterate over pages of elements - * $pagedResponse = $metricServiceClient->listMetricDescriptors($formattedName); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } + * $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: * - * // Alternatively: + * 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. * - * // Iterate through all elements - * $pagedResponse = $metricServiceClient->listMetricDescriptors($formattedName); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } + * The maximum number of `TimeSeries` objects per `Create` request is 200. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @throws ApiException if the remote call fails + */ + public function createTimeSeries($name, $timeSeries, array $optionalArgs = []) + { + $request = new CreateTimeSeriesRequest(); + $requestParamHeaders = []; + $request->setName($name); + $request->setTimeSeries($timeSeries); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateTimeSeries', GPBEmpty::class, $optionalArgs, $request)->wait(); + } + + /** + * Deletes a metric descriptor. Only user-created + * [custom metrics](https://cloud.google.com/monitoring/custom-metrics) can be + * deleted. + * + * Sample code: + * ``` + * $metricServiceClient = new Google\Cloud\Monitoring\V3\MetricServiceClient(); + * try { + * $formattedName = $metricServiceClient->metricDescriptorName('[PROJECT]', '[METRIC_DESCRIPTOR]'); + * $metricServiceClient->deleteMetricDescriptor($formattedName); * } finally { * $metricServiceClient->close(); * } * ``` * - * @param string $name Required. The project 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] - * @param array $optionalArgs { - * Optional. + * 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 string $filter - * If this field is empty, all custom and - * system-defined metric descriptors are returned. - * Otherwise, the [filter](https://cloud.google.com/monitoring/api/v3/filters) - * specifies which metric descriptors are to be - * returned. For example, the following filter matches all - * [custom metrics](https://cloud.google.com/monitoring/custom-metrics): - * - * metric.type = starts_with("custom.googleapis.com/") - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * - * @return \Google\ApiCore\PagedListResponse - * * @throws ApiException if the remote call fails */ - public function listMetricDescriptors($name, array $optionalArgs = []) + public function deleteMetricDescriptor($name, array $optionalArgs = []) { - $request = new ListMetricDescriptorsRequest(); + $request = new DeleteMetricDescriptorRequest(); + $requestParamHeaders = []; $request->setName($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([ - 'name' => $request->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->getPagedListResponse( - 'ListMetricDescriptors', - $optionalArgs, - ListMetricDescriptorsResponse::class, - $request - ); + $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(); } /** @@ -589,20 +817,20 @@ public function listMetricDescriptors($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] + * 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. + * An example value of `[METRIC_ID]` is + * `"compute.googleapis.com/instance/disk/read_bytes_count"`. + * @param array $optionalArgs { + * Optional. * * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * * @return \Google\Api\MetricDescriptor @@ -612,132 +840,225 @@ public function listMetricDescriptors($name, array $optionalArgs = []) 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(); + } - $requestParams = new RequestParamsHeaderDescriptor([ - 'name' => $request->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'GetMetricDescriptor', - MetricDescriptor::class, - $optionalArgs, - $request - )->wait(); + /** + * Gets a single monitored resource descriptor. This method does not require a Workspace. + * + * Sample code: + * ``` + * $metricServiceClient = new Google\Cloud\Monitoring\V3\MetricServiceClient(); + * try { + * $formattedName = $metricServiceClient->monitoredResourceDescriptorName('[PROJECT]', '[MONITORED_RESOURCE_DESCRIPTOR]'); + * $response = $metricServiceClient->getMonitoredResourceDescriptor($formattedName); + * } finally { + * $metricServiceClient->close(); + * } + * ``` + * + * @param string $name Required. The monitored resource descriptor to get. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER]/monitoredResourceDescriptors/[RESOURCE_TYPE] + * + * The `[RESOURCE_TYPE]` is a predefined type, such as + * `cloudsql_database`. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\Api\MonitoredResourceDescriptor + * + * @throws ApiException if the remote call fails + */ + public function getMonitoredResourceDescriptor($name, array $optionalArgs = []) + { + $request = new GetMonitoredResourceDescriptorRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetMonitoredResourceDescriptor', MonitoredResourceDescriptor::class, $optionalArgs, $request)->wait(); } /** - * Creates a new metric descriptor. - * User-created metric descriptors define - * [custom metrics](https://cloud.google.com/monitoring/custom-metrics). + * Lists metric descriptors that match a filter. This method does not require a Workspace. * * Sample code: * ``` * $metricServiceClient = new Google\Cloud\Monitoring\V3\MetricServiceClient(); * try { - * $formattedName = $metricServiceClient->projectName('[PROJECT]'); - * $metricDescriptor = new Google\Cloud\Monitoring\V3\MetricDescriptor(); - * $response = $metricServiceClient->createMetricDescriptor($formattedName, $metricDescriptor); + * $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 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 MetricDescriptor $metricDescriptor Required. The new [custom metric](https://cloud.google.com/monitoring/custom-metrics) - * descriptor. - * @param array $optionalArgs { - * Optional. + * projects/[PROJECT_ID_OR_NUMBER] + * @param array $optionalArgs { + * Optional. * + * @type string $filter + * If this field is empty, all custom and + * system-defined metric descriptors are returned. + * Otherwise, the [filter](https://cloud.google.com/monitoring/api/v3/filters) + * specifies which metric descriptors are to be + * returned. For example, the following filter matches all + * [custom metrics](https://cloud.google.com/monitoring/custom-metrics): + * + * metric.type = starts_with("custom.googleapis.com/") + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * - * @return \Google\Api\MetricDescriptor + * @return \Google\ApiCore\PagedListResponse * * @throws ApiException if the remote call fails */ - public function createMetricDescriptor($name, $metricDescriptor, array $optionalArgs = []) + public function listMetricDescriptors($name, array $optionalArgs = []) { - $request = new CreateMetricDescriptorRequest(); + $request = new ListMetricDescriptorsRequest(); + $requestParamHeaders = []; $request->setName($name); - $request->setMetricDescriptor($metricDescriptor); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } - $requestParams = new RequestParamsHeaderDescriptor([ - 'name' => $request->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } - return $this->startCall( - 'CreateMetricDescriptor', - MetricDescriptor::class, - $optionalArgs, - $request - )->wait(); + 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); } /** - * Deletes a metric descriptor. Only user-created - * [custom metrics](https://cloud.google.com/monitoring/custom-metrics) can be - * deleted. + * Lists monitored resource descriptors that match a filter. This method does not require a Workspace. * * Sample code: * ``` * $metricServiceClient = new Google\Cloud\Monitoring\V3\MetricServiceClient(); * try { - * $formattedName = $metricServiceClient->metricDescriptorName('[PROJECT]', '[METRIC_DESCRIPTOR]'); - * $metricServiceClient->deleteMetricDescriptor($formattedName); + * $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 metric descriptor 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]/metricDescriptors/[METRIC_ID] + * projects/[PROJECT_ID_OR_NUMBER] + * @param array $optionalArgs { + * Optional. * - * An example of `[METRIC_ID]` is: - * `"custom.googleapis.com/my_test_metric"`. - * @param array $optionalArgs { - * Optional. + * @type string $filter + * An optional [filter](https://cloud.google.com/monitoring/api/v3/filters) + * describing the descriptors to be returned. The filter can reference the + * descriptor's type and labels. For example, the following filter returns + * only Google Compute Engine descriptors that have an `id` label: * + * resource.type = starts_with("gce_") AND resource.label:id + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * + * @return \Google\ApiCore\PagedListResponse + * * @throws ApiException if the remote call fails */ - public function deleteMetricDescriptor($name, array $optionalArgs = []) + public function listMonitoredResourceDescriptors($name, array $optionalArgs = []) { - $request = new DeleteMetricDescriptorRequest(); + $request = new ListMonitoredResourceDescriptorsRequest(); + $requestParamHeaders = []; $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } - $requestParams = new RequestParamsHeaderDescriptor([ - 'name' => $request->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } - return $this->startCall( - 'DeleteMetricDescriptor', - GPBEmpty::class, - $optionalArgs, - $request - )->wait(); + $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); } /** @@ -747,8 +1068,8 @@ public function deleteMetricDescriptor($name, array $optionalArgs = []) * ``` * $metricServiceClient = new Google\Cloud\Monitoring\V3\MetricServiceClient(); * try { - * $formattedName = $metricServiceClient->projectName('[PROJECT]'); - * $filter = ''; + * $formattedName = $metricServiceClient->workspaceName('[PROJECT]'); + * $filter = 'filter'; * $interval = new Google\Cloud\Monitoring\V3\TimeInterval(); * $view = Google\Cloud\Monitoring\V3\ListTimeSeriesRequest\TimeSeriesView::FULL; * // Iterate over pages of elements @@ -758,10 +1079,7 @@ public function deleteMetricDescriptor($name, array $optionalArgs = []) * // doSomethingWith($element); * } * } - * - * * // Alternatively: - * * // Iterate through all elements * $pagedResponse = $metricServiceClient->listTimeSeries($formattedName, $filter, $interval, $view); * foreach ($pagedResponse->iterateAllElements() as $element) { @@ -772,47 +1090,53 @@ public function deleteMetricDescriptor($name, array $optionalArgs = []) * } * ``` * - * @param string $name Required. The project on which to execute the request. The format is: + * @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] - * @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: + * 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" + * 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. + * 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. + * 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). + * 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. + * 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. + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * * @return \Google\ApiCore\PagedListResponse @@ -822,96 +1146,34 @@ public function deleteMetricDescriptor($name, array $optionalArgs = []) 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([ - 'name' => $request->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->getPagedListResponse( - 'ListTimeSeries', - $optionalArgs, - ListTimeSeriesResponse::class, - $request - ); - } - - /** - * Creates or adds data to one or more time series. - * The response is empty if all time series in the request were written. - * If any time series could not be written, a corresponding failure message is - * included in the error response. - * - * Sample code: - * ``` - * $metricServiceClient = new Google\Cloud\Monitoring\V3\MetricServiceClient(); - * try { - * $formattedName = $metricServiceClient->projectName('[PROJECT]'); - * $timeSeries = []; - * $metricServiceClient->createTimeSeries($formattedName, $timeSeries); - * } finally { - * $metricServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The project on which to execute the request. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER] - * @param TimeSeries[] $timeSeries Required. The new data to be added to a list of time series. - * Adds at most one data point to each of several time series. The new data - * point must be more recent than any other point in its time series. Each - * `TimeSeries` value must fully specify a unique time series by supplying - * all label values for the metric and the monitored resource. - * - * The maximum number of `TimeSeries` objects per `Create` request is 200. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - */ - public function createTimeSeries($name, $timeSeries, array $optionalArgs = []) - { - $request = new CreateTimeSeriesRequest(); - $request->setName($name); - $request->setTimeSeries($timeSeries); - - $requestParams = new RequestParamsHeaderDescriptor([ - 'name' => $request->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'CreateTimeSeries', - GPBEmpty::class, - $optionalArgs, - $request - )->wait(); + $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/Monitoring/src/V3/Gapic/NotificationChannelServiceGapicClient.php b/Monitoring/src/V3/Gapic/NotificationChannelServiceGapicClient.php index 9af453c66f1..3e97ff949f8 100644 --- a/Monitoring/src/V3/Gapic/NotificationChannelServiceGapicClient.php +++ b/Monitoring/src/V3/Gapic/NotificationChannelServiceGapicClient.php @@ -17,9 +17,9 @@ /* * GENERATED CODE WARNING - * This file was generated from the file - * https://github.com/google/googleapis/blob/master/google/monitoring/v3/notification_service.proto - * and updates to that file get reflected here through a refresh process. + * Generated by gapic-generator-php from the file + * https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/notification_service.proto + * Updates to the above are reflected here through a refresh process. */ namespace Google\Cloud\Monitoring\V3\Gapic; @@ -27,6 +27,7 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; + use Google\ApiCore\PathTemplate; use Google\ApiCore\RequestParamsHeaderDescriptor; use Google\ApiCore\RetrySettings; @@ -62,32 +63,18 @@ * ``` * $notificationChannelServiceClient = new Google\Cloud\Monitoring\V3\NotificationChannelServiceClient(); * try { - * $formattedName = $notificationChannelServiceClient->projectName('[PROJECT]'); - * // Iterate over pages of elements - * $pagedResponse = $notificationChannelServiceClient->listNotificationChannelDescriptors($formattedName); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * - * - * // Alternatively: - * - * // Iterate through all elements - * $pagedResponse = $notificationChannelServiceClient->listNotificationChannelDescriptors($formattedName); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } + * $name = 'name'; + * $notificationChannel = new Google\Cloud\Monitoring\V3\NotificationChannel(); + * $response = $notificationChannelServiceClient->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. + * Many parameters require resource names to be formatted in a particular way. To + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. */ class NotificationChannelServiceGapicClient { @@ -120,35 +107,66 @@ class NotificationChannelServiceGapicClient '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 $folderChannelDescriptorNameTemplate; + + private static $folderNotificationChannelNameTemplate; + private static $notificationChannelNameTemplate; + private static $notificationChannelDescriptorNameTemplate; - private static $projectNameTemplate; + + 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', + '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' => [ - 'scopes' => self::$serviceScopes, + 'defaultScopes' => self::$serviceScopes, ], 'transportConfig' => [ 'rest' => [ - 'restClientConfigPath' => __DIR__.'/../resources/notification_channel_service_rest_client_config.php', + '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 (null == self::$notificationChannelNameTemplate) { + if (self::$notificationChannelNameTemplate == null) { self::$notificationChannelNameTemplate = new PathTemplate('projects/{project}/notificationChannels/{notification_channel}'); } @@ -157,29 +175,61 @@ private static function getNotificationChannelNameTemplate() private static function getNotificationChannelDescriptorNameTemplate() { - if (null == self::$notificationChannelDescriptorNameTemplate) { + if (self::$notificationChannelDescriptorNameTemplate == null) { self::$notificationChannelDescriptorNameTemplate = new PathTemplate('projects/{project}/notificationChannelDescriptors/{channel_descriptor}'); } return self::$notificationChannelDescriptorNameTemplate; } - private static function getProjectNameTemplate() + 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 (null == self::$projectNameTemplate) { - self::$projectNameTemplate = new PathTemplate('projects/{project}'); + if (self::$projectChannelDescriptorNameTemplate == null) { + self::$projectChannelDescriptorNameTemplate = new PathTemplate('projects/{project}/notificationChannelDescriptors/{channel_descriptor}'); } - return self::$projectNameTemplate; + 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 (null == self::$pathTemplateMap) { + if (self::$pathTemplateMap == null) { self::$pathTemplateMap = [ + 'folderChannelDescriptor' => self::getFolderChannelDescriptorNameTemplate(), + 'folderNotificationChannel' => self::getFolderNotificationChannelNameTemplate(), 'notificationChannel' => self::getNotificationChannelNameTemplate(), 'notificationChannelDescriptor' => self::getNotificationChannelDescriptorNameTemplate(), - 'project' => self::getProjectNameTemplate(), + 'organizationChannelDescriptor' => self::getOrganizationChannelDescriptorNameTemplate(), + 'organizationNotificationChannel' => self::getOrganizationNotificationChannelNameTemplate(), + 'projectChannelDescriptor' => self::getProjectChannelDescriptorNameTemplate(), + 'projectNotificationChannel' => self::getProjectNotificationChannelNameTemplate(), ]; } @@ -187,8 +237,42 @@ private static function getPathTemplateMap() } /** - * Formats a string containing the fully-qualified path to represent - * a notification_channel resource. + * 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 @@ -204,8 +288,8 @@ public static function notificationChannelName($project, $notificationChannel) } /** - * Formats a string containing the fully-qualified path to represent - * a notification_channel_descriptor resource. + * Formats a string containing the fully-qualified path to represent a + * notification_channel_descriptor resource. * * @param string $project * @param string $channelDescriptor @@ -221,17 +305,70 @@ public static function notificationChannelDescriptorName($project, $channelDescr } /** - * Formats a string containing the fully-qualified path to represent - * a project resource. + * 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 resource. + * @return string The formatted project_notification_channel resource. */ - public static function projectName($project) + public static function projectNotificationChannelName($project, $notificationChannel) { - return self::getProjectNameTemplate()->render([ + return self::getProjectNotificationChannelNameTemplate()->render([ 'project' => $project, + 'notification_channel' => $notificationChannel, ]); } @@ -239,14 +376,20 @@ public static function projectName($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 + * - folderChannelDescriptor: folders/{folder}/notificationChannelDescriptors/{channel_descriptor} + * - folderNotificationChannel: folders/{folder}/notificationChannels/{notification_channel} * - notificationChannel: projects/{project}/notificationChannels/{notification_channel} * - notificationChannelDescriptor: projects/{project}/notificationChannelDescriptors/{channel_descriptor} - * - project: projects/{project}. + * - 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. + * 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 @@ -258,7 +401,6 @@ public static function projectName($project) 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"); @@ -274,6 +416,7 @@ public static function parseName($formattedName, $template = null) // Swallow the exception to continue trying other path templates } } + throw new ValidationException("Input did not match any known format. Input: $formattedName"); } @@ -281,7 +424,7 @@ public static function parseName($formattedName, $template = null) * Constructor. * * @param array $options { - * Optional. Options for configuring the service API wrapper. + * Optional. Options for configuring the service API wrapper. * * @type string $serviceAddress * **Deprecated**. This option will be removed in a future major release. Please @@ -298,35 +441,38 @@ public static function parseName($formattedName, $template = null) * {@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()}. + * 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. + * 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. + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $serviceAddress setting, will be ignored. * @type array $transportConfig * Configuration options that will be used to construct the transport. Options for * each supported transport type should be passed in a key for that transport. For * example: * $transportConfig = [ * 'grpc' => [...], - * 'rest' => [...] + * '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 @@ -338,480 +484,449 @@ public function __construct(array $options = []) } /** - * Lists the descriptors for supported channel types. The use of descriptors - * makes it possible for new channel types to be dynamically added. + * Creates a new notification channel, representing a single notification + * endpoint such as an email address, SMS number, or PagerDuty service. * * Sample code: * ``` * $notificationChannelServiceClient = new Google\Cloud\Monitoring\V3\NotificationChannelServiceClient(); * try { - * $formattedName = $notificationChannelServiceClient->projectName('[PROJECT]'); - * // Iterate over pages of elements - * $pagedResponse = $notificationChannelServiceClient->listNotificationChannelDescriptors($formattedName); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * - * - * // Alternatively: - * - * // Iterate through all elements - * $pagedResponse = $notificationChannelServiceClient->listNotificationChannelDescriptors($formattedName); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } + * $name = 'name'; + * $notificationChannel = new Google\Cloud\Monitoring\V3\NotificationChannel(); + * $response = $notificationChannelServiceClient->createNotificationChannel($name, $notificationChannel); * } 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: + * @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] + * projects/[PROJECT_ID_OR_NUMBER] * - * Note that this names 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. + * 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 int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * - * @return \Google\ApiCore\PagedListResponse + * @return \Google\Cloud\Monitoring\V3\NotificationChannel * * @throws ApiException if the remote call fails */ - public function listNotificationChannelDescriptors($name, array $optionalArgs = []) + public function createNotificationChannel($name, $notificationChannel, array $optionalArgs = []) { - $request = new ListNotificationChannelDescriptorsRequest(); + $request = new CreateNotificationChannelRequest(); + $requestParamHeaders = []; $request->setName($name); - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor([ - 'name' => $request->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->getPagedListResponse( - 'ListNotificationChannelDescriptors', - $optionalArgs, - ListNotificationChannelDescriptorsResponse::class, - $request - ); + $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(); } /** - * Gets a single channel descriptor. The descriptor indicates which fields - * are expected / permitted for a notification channel of the given type. + * Deletes a notification channel. * * Sample code: * ``` * $notificationChannelServiceClient = new Google\Cloud\Monitoring\V3\NotificationChannelServiceClient(); * try { - * $formattedName = $notificationChannelServiceClient->notificationChannelDescriptorName('[PROJECT]', '[CHANNEL_DESCRIPTOR]'); - * $response = $notificationChannelServiceClient->getNotificationChannelDescriptor($formattedName); + * $formattedName = $notificationChannelServiceClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + * $notificationChannelServiceClient->deleteNotificationChannel($formattedName); * } finally { * $notificationChannelServiceClient->close(); * } * ``` * - * @param string $name Required. The channel type for which to execute the request. The format is: + * @param string $name Required. The channel for which to execute the request. The format is: * - * projects/[PROJECT_ID_OR_NUMBER]/notificationChannelDescriptors/[CHANNEL_TYPE] - * @param array $optionalArgs { - * Optional. + * projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] + * @param array $optionalArgs { + * Optional. * + * @type bool $force + * If true, the notification channel will be deleted regardless of its + * use in alert policies (the policies will be updated to remove the + * channel). If false, channels that are still referenced by an existing + * alerting policy will fail to be deleted in a delete operation. * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * - * @return \Google\Cloud\Monitoring\V3\NotificationChannelDescriptor - * * @throws ApiException if the remote call fails */ - public function getNotificationChannelDescriptor($name, array $optionalArgs = []) + public function deleteNotificationChannel($name, array $optionalArgs = []) { - $request = new GetNotificationChannelDescriptorRequest(); + $request = new DeleteNotificationChannelRequest(); + $requestParamHeaders = []; $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['force'])) { + $request->setForce($optionalArgs['force']); + } - $requestParams = new RequestParamsHeaderDescriptor([ - 'name' => $request->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'GetNotificationChannelDescriptor', - NotificationChannelDescriptor::class, - $optionalArgs, - $request - )->wait(); + $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(); } /** - * Lists the notification channels that have been created for the project. + * 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 Google\Cloud\Monitoring\V3\NotificationChannelServiceClient(); * try { - * $formattedName = $notificationChannelServiceClient->projectName('[PROJECT]'); - * // Iterate over pages of elements - * $pagedResponse = $notificationChannelServiceClient->listNotificationChannels($formattedName); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * - * - * // Alternatively: - * - * // Iterate through all elements - * $pagedResponse = $notificationChannelServiceClient->listNotificationChannels($formattedName); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } + * $formattedName = $notificationChannelServiceClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + * $response = $notificationChannelServiceClient->getNotificationChannel($formattedName); * } finally { * $notificationChannelServiceClient->close(); * } * ``` * - * @param string $name Required. The project on which to execute the request. The format is: + * @param string $name Required. The channel for 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. + * projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] + * @param array $optionalArgs { + * Optional. * - * For more details, see [sorting and - * filtering](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering). - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * - * @return \Google\ApiCore\PagedListResponse + * @return \Google\Cloud\Monitoring\V3\NotificationChannel * * @throws ApiException if the remote call fails */ - public function listNotificationChannels($name, array $optionalArgs = []) + public function getNotificationChannel($name, array $optionalArgs = []) { - $request = new ListNotificationChannelsRequest(); + $request = new GetNotificationChannelRequest(); + $requestParamHeaders = []; $request->setName($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([ - 'name' => $request->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->getPagedListResponse( - 'ListNotificationChannels', - $optionalArgs, - ListNotificationChannelsResponse::class, - $request - ); + $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 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. + * 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 Google\Cloud\Monitoring\V3\NotificationChannelServiceClient(); * try { - * $formattedName = $notificationChannelServiceClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - * $response = $notificationChannelServiceClient->getNotificationChannel($formattedName); + * $formattedName = $notificationChannelServiceClient->notificationChannelDescriptorName('[PROJECT]', '[CHANNEL_DESCRIPTOR]'); + * $response = $notificationChannelServiceClient->getNotificationChannelDescriptor($formattedName); * } finally { * $notificationChannelServiceClient->close(); * } * ``` * - * @param string $name Required. The channel for which to execute the request. The format is: + * @param string $name Required. The channel type for which to execute the request. The format is: * - * projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] - * @param array $optionalArgs { - * Optional. + * projects/[PROJECT_ID_OR_NUMBER]/notificationChannelDescriptors/[CHANNEL_TYPE] + * @param array $optionalArgs { + * Optional. * * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * - * @return \Google\Cloud\Monitoring\V3\NotificationChannel + * @return \Google\Cloud\Monitoring\V3\NotificationChannelDescriptor * * @throws ApiException if the remote call fails */ - public function getNotificationChannel($name, array $optionalArgs = []) + public function getNotificationChannelDescriptor($name, array $optionalArgs = []) { - $request = new GetNotificationChannelRequest(); + $request = new GetNotificationChannelDescriptorRequest(); + $requestParamHeaders = []; $request->setName($name); - - $requestParams = new RequestParamsHeaderDescriptor([ - 'name' => $request->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'GetNotificationChannel', - NotificationChannel::class, - $optionalArgs, - $request - )->wait(); + $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(); } /** - * Creates a new notification channel, representing a single notification - * endpoint such as an email address, SMS number, or PagerDuty service. + * 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 Google\Cloud\Monitoring\V3\NotificationChannelServiceClient(); * try { - * $formattedName = $notificationChannelServiceClient->projectName('[PROJECT]'); - * $notificationChannel = new Google\Cloud\Monitoring\V3\NotificationChannel(); - * $response = $notificationChannelServiceClient->createNotificationChannel($formattedName, $notificationChannel); + * $formattedName = $notificationChannelServiceClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + * $response = $notificationChannelServiceClient->getNotificationChannelVerificationCode($formattedName); * } finally { * $notificationChannelServiceClient->close(); * } * ``` * - * @param string $name Required. The project 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. + * @param string $name Required. The notification channel for which a verification code is to be generated + * and retrieved. This must name a channel that is already verified; if + * the specified channel is not verified, the request will fail. + * @param array $optionalArgs { + * Optional. * + * @type Timestamp $expireTime + * The desired expiration time. If specified, the API will guarantee that + * the returned code will not be valid after the specified timestamp; + * however, the API cannot guarantee that the returned code will be + * valid for at least as long as the requested time (the API puts an upper + * bound on the amount of time for which a code may be valid). If omitted, + * a default expiration will be used, which may be less than the max + * permissible expiration (so specifying an expiration may extend the + * code's lifetime over omitting an expiration, even though the API does + * impose an upper limit on the maximum expiration that is permitted). * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * - * @return \Google\Cloud\Monitoring\V3\NotificationChannel + * @return \Google\Cloud\Monitoring\V3\GetNotificationChannelVerificationCodeResponse * * @throws ApiException if the remote call fails */ - public function createNotificationChannel($name, $notificationChannel, array $optionalArgs = []) + public function getNotificationChannelVerificationCode($name, array $optionalArgs = []) { - $request = new CreateNotificationChannelRequest(); + $request = new GetNotificationChannelVerificationCodeRequest(); + $requestParamHeaders = []; $request->setName($name); - $request->setNotificationChannel($notificationChannel); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['expireTime'])) { + $request->setExpireTime($optionalArgs['expireTime']); + } - $requestParams = new RequestParamsHeaderDescriptor([ - 'name' => $request->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'CreateNotificationChannel', - NotificationChannel::class, - $optionalArgs, - $request - )->wait(); + $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(); } /** - * Updates a notification channel. Fields not specified in the field mask - * remain unchanged. + * 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 Google\Cloud\Monitoring\V3\NotificationChannelServiceClient(); * try { - * $notificationChannel = new Google\Cloud\Monitoring\V3\NotificationChannel(); - * $response = $notificationChannelServiceClient->updateNotificationChannel($notificationChannel); + * $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 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. + * @param string $name Required. The REST resource name of the parent from which to retrieve + * the notification channel descriptors. The expected syntax is: * - * @type FieldMask $updateMask - * The fields to update. + * projects/[PROJECT_ID_OR_NUMBER] + * + * Note that this + * [names](https://cloud.google.com/monitoring/api/v3#project_name) the parent + * container in which to look for the descriptors; to retrieve a single + * descriptor by name, use the + * [GetNotificationChannelDescriptor][google.monitoring.v3.NotificationChannelService.GetNotificationChannelDescriptor] + * operation, instead. + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * - * @return \Google\Cloud\Monitoring\V3\NotificationChannel + * @return \Google\ApiCore\PagedListResponse * * @throws ApiException if the remote call fails */ - public function updateNotificationChannel($notificationChannel, array $optionalArgs = []) + public function listNotificationChannelDescriptors($name, array $optionalArgs = []) { - $request = new UpdateNotificationChannelRequest(); - $request->setNotificationChannel($notificationChannel); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); + $request = new ListNotificationChannelDescriptorsRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); } - $requestParams = new RequestParamsHeaderDescriptor([ - 'notification_channel.name' => $request->getNotificationChannel()->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'UpdateNotificationChannel', - NotificationChannel::class, - $optionalArgs, - $request - )->wait(); + 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); } /** - * Deletes a notification channel. + * Lists the notification channels that have been created for the project. * * Sample code: * ``` * $notificationChannelServiceClient = new Google\Cloud\Monitoring\V3\NotificationChannelServiceClient(); * try { - * $formattedName = $notificationChannelServiceClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - * $notificationChannelServiceClient->deleteNotificationChannel($formattedName); + * $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 channel for 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]/notificationChannels/[CHANNEL_ID] - * @param array $optionalArgs { - * Optional. + * projects/[PROJECT_ID_OR_NUMBER] * - * @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. + * This names the container + * in which to look for the notification channels; it does not name a + * specific channel. To query a specific channel by REST resource name, use + * the + * [`GetNotificationChannel`][google.monitoring.v3.NotificationChannelService.GetNotificationChannel] + * operation. + * @param array $optionalArgs { + * Optional. + * + * @type string $filter + * If provided, this field specifies the criteria that must be met by + * notification channels to be included in the response. + * + * For more details, see [sorting and + * filtering](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering). + * @type string $orderBy + * A comma-separated list of fields by which to sort the result. Supports + * the same set of fields as in `filter`. Entries can be prefixed with + * a minus sign to sort in descending rather than ascending order. + * + * For more details, see [sorting and + * filtering](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering). + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * + * @return \Google\ApiCore\PagedListResponse + * * @throws ApiException if the remote call fails */ - public function deleteNotificationChannel($name, array $optionalArgs = []) + public function listNotificationChannels($name, array $optionalArgs = []) { - $request = new DeleteNotificationChannelRequest(); + $request = new ListNotificationChannelsRequest(); + $requestParamHeaders = []; $request->setName($name); - if (isset($optionalArgs['force'])) { - $request->setForce($optionalArgs['force']); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); } - $requestParams = new RequestParamsHeaderDescriptor([ - 'name' => $request->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'DeleteNotificationChannel', - GPBEmpty::class, - $optionalArgs, - $request - )->wait(); + 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); } /** @@ -831,13 +946,13 @@ public function deleteNotificationChannel($name, array $optionalArgs = []) * * @param string $name Required. The notification channel to which to send a verification code. * @param array $optionalArgs { - * Optional. + * Optional. * * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * * @throws ApiException if the remote call fails @@ -845,105 +960,62 @@ public function deleteNotificationChannel($name, array $optionalArgs = []) public function sendNotificationChannelVerificationCode($name, array $optionalArgs = []) { $request = new SendNotificationChannelVerificationCodeRequest(); + $requestParamHeaders = []; $request->setName($name); - - $requestParams = new RequestParamsHeaderDescriptor([ - 'name' => $request->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'SendNotificationChannelVerificationCode', - GPBEmpty::class, - $optionalArgs, - $request - )->wait(); + $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(); } /** - * 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. + * Updates a notification channel. Fields not specified in the field mask + * remain unchanged. * * Sample code: * ``` * $notificationChannelServiceClient = new Google\Cloud\Monitoring\V3\NotificationChannelServiceClient(); * try { - * $formattedName = $notificationChannelServiceClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - * $response = $notificationChannelServiceClient->getNotificationChannelVerificationCode($formattedName); + * $notificationChannel = new Google\Cloud\Monitoring\V3\NotificationChannel(); + * $response = $notificationChannelServiceClient->updateNotificationChannel($notificationChannel); * } 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. + * @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 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 FieldMask $updateMask + * The fields to update. * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * - * @return \Google\Cloud\Monitoring\V3\GetNotificationChannelVerificationCodeResponse + * @return \Google\Cloud\Monitoring\V3\NotificationChannel * * @throws ApiException if the remote call fails */ - public function getNotificationChannelVerificationCode($name, array $optionalArgs = []) + public function updateNotificationChannel($notificationChannel, array $optionalArgs = []) { - $request = new GetNotificationChannelVerificationCodeRequest(); - $request->setName($name); - if (isset($optionalArgs['expireTime'])) { - $request->setExpireTime($optionalArgs['expireTime']); + $request = new UpdateNotificationChannelRequest(); + $requestParamHeaders = []; + $request->setNotificationChannel($notificationChannel); + $requestParamHeaders['notification_channel.name'] = $notificationChannel->getName(); + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); } - $requestParams = new RequestParamsHeaderDescriptor([ - 'name' => $request->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'GetNotificationChannelVerificationCode', - GetNotificationChannelVerificationCodeResponse::class, - $optionalArgs, - $request - )->wait(); + $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(); } /** @@ -956,7 +1028,7 @@ public function getNotificationChannelVerificationCode($name, array $optionalArg * $notificationChannelServiceClient = new Google\Cloud\Monitoring\V3\NotificationChannelServiceClient(); * try { * $formattedName = $notificationChannelServiceClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - * $code = ''; + * $code = 'code'; * $response = $notificationChannelServiceClient->verifyNotificationChannel($formattedName, $code); * } finally { * $notificationChannelServiceClient->close(); @@ -972,13 +1044,13 @@ public function getNotificationChannelVerificationCode($name, array $optionalArg * 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. + * Optional. * * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * * @return \Google\Cloud\Monitoring\V3\NotificationChannel @@ -988,21 +1060,12 @@ public function getNotificationChannelVerificationCode($name, array $optionalArg public function verifyNotificationChannel($name, $code, array $optionalArgs = []) { $request = new VerifyNotificationChannelRequest(); + $requestParamHeaders = []; $request->setName($name); $request->setCode($code); - - $requestParams = new RequestParamsHeaderDescriptor([ - 'name' => $request->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'VerifyNotificationChannel', - NotificationChannel::class, - $optionalArgs, - $request - )->wait(); + $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/Monitoring/src/V3/Gapic/QueryServiceGapicClient.php similarity index 97% rename from owl-bot-staging/Monitoring/v3/src/V3/Gapic/QueryServiceGapicClient.php rename to Monitoring/src/V3/Gapic/QueryServiceGapicClient.php index b4d099f5da0..acd0e3ef1f7 100644 --- a/owl-bot-staging/Monitoring/v3/src/V3/Gapic/QueryServiceGapicClient.php +++ b/Monitoring/src/V3/Gapic/QueryServiceGapicClient.php @@ -104,7 +104,7 @@ private static function getClientDefaults() { return [ 'serviceName' => self::SERVICE_NAME, - 'serviceAddress' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + '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', @@ -126,6 +126,9 @@ private static function getClientDefaults() * Optional. Options for configuring the service API wrapper. * * @type string $serviceAddress + * **Deprecated**. This option will be removed in a future major release. Please + * utilize the `$apiEndpoint` option instead. + * @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 diff --git a/Monitoring/src/V3/Gapic/ServiceMonitoringServiceGapicClient.php b/Monitoring/src/V3/Gapic/ServiceMonitoringServiceGapicClient.php index e781be016cf..c50d0c4cba4 100644 --- a/Monitoring/src/V3/Gapic/ServiceMonitoringServiceGapicClient.php +++ b/Monitoring/src/V3/Gapic/ServiceMonitoringServiceGapicClient.php @@ -17,9 +17,9 @@ /* * GENERATED CODE WARNING - * This file was generated from the file - * https://github.com/google/googleapis/blob/master/google/monitoring/v3/service_service.proto - * and updates to that file get reflected here through a refresh process. + * Generated by gapic-generator-php from the file + * https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service_service.proto + * Updates to the above are reflected here through a refresh process. */ namespace Google\Cloud\Monitoring\V3\Gapic; @@ -27,6 +27,7 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; + use Google\ApiCore\PathTemplate; use Google\ApiCore\RequestParamsHeaderDescriptor; use Google\ApiCore\RetrySettings; @@ -63,18 +64,18 @@ * ``` * $serviceMonitoringServiceClient = new ServiceMonitoringServiceClient(); * try { - * $formattedParent = $serviceMonitoringServiceClient->projectName('[PROJECT]'); + * $parent = 'parent'; * $service = new Service(); - * $response = $serviceMonitoringServiceClient->createService($formattedParent, $service); + * $response = $serviceMonitoringServiceClient->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. + * Many parameters require resource names to be formatted in a particular way. To + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. */ class ServiceMonitoringServiceGapicClient { @@ -107,44 +108,102 @@ class ServiceMonitoringServiceGapicClient '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 $projectNameTemplate; + + 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', + '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' => [ - 'scopes' => self::$serviceScopes, + 'defaultScopes' => self::$serviceScopes, ], 'transportConfig' => [ 'rest' => [ - 'restClientConfigPath' => __DIR__.'/../resources/service_monitoring_service_rest_client_config.php', + 'restClientConfigPath' => __DIR__ . '/../resources/service_monitoring_service_rest_client_config.php', ], ], ]; } - private static function getProjectNameTemplate() + 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 (null == self::$projectNameTemplate) { - self::$projectNameTemplate = new PathTemplate('projects/{project}'); + if (self::$organizationServiceServiceLevelObjectiveNameTemplate == null) { + self::$organizationServiceServiceLevelObjectiveNameTemplate = new PathTemplate('organizations/{organization}/services/{service}/serviceLevelObjectives/{service_level_objective}'); } - return self::$projectNameTemplate; + 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 (null == self::$serviceNameTemplate) { + if (self::$serviceNameTemplate == null) { self::$serviceNameTemplate = new PathTemplate('projects/{project}/services/{service}'); } @@ -153,7 +212,7 @@ private static function getServiceNameTemplate() private static function getServiceLevelObjectiveNameTemplate() { - if (null == self::$serviceLevelObjectiveNameTemplate) { + if (self::$serviceLevelObjectiveNameTemplate == null) { self::$serviceLevelObjectiveNameTemplate = new PathTemplate('projects/{project}/services/{service}/serviceLevelObjectives/{service_level_objective}'); } @@ -162,9 +221,14 @@ private static function getServiceLevelObjectiveNameTemplate() private static function getPathTemplateMap() { - if (null == self::$pathTemplateMap) { + if (self::$pathTemplateMap == null) { self::$pathTemplateMap = [ - 'project' => self::getProjectNameTemplate(), + 'folderService' => self::getFolderServiceNameTemplate(), + 'folderServiceServiceLevelObjective' => self::getFolderServiceServiceLevelObjectiveNameTemplate(), + 'organizationService' => self::getOrganizationServiceNameTemplate(), + 'organizationServiceServiceLevelObjective' => self::getOrganizationServiceServiceLevelObjectiveNameTemplate(), + 'projectService' => self::getProjectServiceNameTemplate(), + 'projectServiceServiceLevelObjective' => self::getProjectServiceServiceLevelObjectiveNameTemplate(), 'service' => self::getServiceNameTemplate(), 'serviceLevelObjective' => self::getServiceLevelObjectiveNameTemplate(), ]; @@ -174,23 +238,116 @@ private static function getPathTemplateMap() } /** - * Formats a string containing the fully-qualified path to represent - * a project resource. + * 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 resource. + * @return string The formatted project_service resource. */ - public static function projectName($project) + public static function projectServiceName($project, $service) { - return self::getProjectNameTemplate()->render([ + return self::getProjectServiceNameTemplate()->render([ 'project' => $project, + 'service' => $service, ]); } /** - * Formats a string containing the fully-qualified path to represent - * a service resource. + * 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 @@ -206,8 +363,8 @@ public static function serviceName($project, $service) } /** - * Formats a string containing the fully-qualified path to represent - * a service_level_objective resource. + * Formats a string containing the fully-qualified path to represent a + * service_level_objective resource. * * @param string $project * @param string $service @@ -228,14 +385,20 @@ public static function serviceLevelObjectiveName($project, $service, $serviceLev * Parses a formatted name string and returns an associative array of the components in the name. * The following name formats are supported: * Template: Pattern - * - project: projects/{project} + * - 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}. + * - 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. + * 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 @@ -247,7 +410,6 @@ public static function serviceLevelObjectiveName($project, $service, $serviceLev 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"); @@ -263,6 +425,7 @@ public static function parseName($formattedName, $template = null) // Swallow the exception to continue trying other path templates } } + throw new ValidationException("Input did not match any known format. Input: $formattedName"); } @@ -270,7 +433,7 @@ public static function parseName($formattedName, $template = null) * Constructor. * * @param array $options { - * Optional. Options for configuring the service API wrapper. + * Optional. Options for configuring the service API wrapper. * * @type string $serviceAddress * **Deprecated**. This option will be removed in a future major release. Please @@ -287,35 +450,38 @@ public static function parseName($formattedName, $template = null) * {@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()}. + * 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. + * 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. + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $serviceAddress setting, will be ignored. * @type array $transportConfig * Configuration options that will be used to construct the transport. Options for * each supported transport type should be passed in a key for that transport. For * example: * $transportConfig = [ * 'grpc' => [...], - * 'rest' => [...] + * '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 @@ -333,29 +499,30 @@ public function __construct(array $options = []) * ``` * $serviceMonitoringServiceClient = new ServiceMonitoringServiceClient(); * try { - * $formattedParent = $serviceMonitoringServiceClient->projectName('[PROJECT]'); + * $parent = 'parent'; * $service = new Service(); - * $response = $serviceMonitoringServiceClient->createService($formattedParent, $service); + * $response = $serviceMonitoringServiceClient->createService($parent, $service); * } finally { * $serviceMonitoringServiceClient->close(); * } * ``` * - * @param string $parent Required. Resource 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 workspace. The format is: * - * projects/[PROJECT_ID_OR_NUMBER] + * projects/[PROJECT_ID_OR_NUMBER] * @param Service $service Required. The `Service` to create. * @param array $optionalArgs { - * Optional. + * 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\-]+` + * Optional. The Service id to use for this Service. If omitted, an id will be + * generated instead. Must match the pattern `[a-z0-9\-]+` * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * * @return \Google\Cloud\Monitoring\V3\Service @@ -365,428 +532,355 @@ public function __construct(array $options = []) 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([ - 'parent' => $request->getParent(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'CreateService', - Service::class, - $optionalArgs, - $request - )->wait(); + $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(); } /** - * Get the named `Service`. + * Create a `ServiceLevelObjective` for the given `Service`. * * Sample code: * ``` * $serviceMonitoringServiceClient = new ServiceMonitoringServiceClient(); * try { - * $formattedName = $serviceMonitoringServiceClient->serviceName('[PROJECT]', '[SERVICE]'); - * $response = $serviceMonitoringServiceClient->getService($formattedName); + * $formattedParent = $serviceMonitoringServiceClient->serviceName('[PROJECT]', '[SERVICE]'); + * $serviceLevelObjective = new ServiceLevelObjective(); + * $response = $serviceMonitoringServiceClient->createServiceLevelObjective($formattedParent, $serviceLevelObjective); * } finally { * $serviceMonitoringServiceClient->close(); * } * ``` * - * @param string $name Required. Resource name of the `Service`. The format is: + * @param string $parent Required. Resource name of the parent `Service`. The format is: * - * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] - * @param array $optionalArgs { - * Optional. + * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] + * @param ServiceLevelObjective $serviceLevelObjective Required. The `ServiceLevelObjective` to create. + * The provided `name` will be respected if no `ServiceLevelObjective` exists + * with this name. + * @param array $optionalArgs { + * Optional. * + * @type string $serviceLevelObjectiveId + * Optional. The ServiceLevelObjective id to use for this + * ServiceLevelObjective. If omitted, an id will be generated instead. Must + * match the pattern `[a-z0-9\-]+` * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * - * @return \Google\Cloud\Monitoring\V3\Service + * @return \Google\Cloud\Monitoring\V3\ServiceLevelObjective * * @throws ApiException if the remote call fails */ - public function getService($name, array $optionalArgs = []) + public function createServiceLevelObjective($parent, $serviceLevelObjective, array $optionalArgs = []) { - $request = new GetServiceRequest(); - $request->setName($name); + $request = new CreateServiceLevelObjectiveRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setServiceLevelObjective($serviceLevelObjective); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['serviceLevelObjectiveId'])) { + $request->setServiceLevelObjectiveId($optionalArgs['serviceLevelObjectiveId']); + } - $requestParams = new RequestParamsHeaderDescriptor([ - 'name' => $request->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'GetService', - Service::class, - $optionalArgs, - $request - )->wait(); + $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(); } /** - * List `Service`s for this workspace. + * Soft delete this `Service`. * * Sample code: * ``` * $serviceMonitoringServiceClient = new ServiceMonitoringServiceClient(); * try { - * $formattedParent = $serviceMonitoringServiceClient->projectName('[PROJECT]'); - * // Iterate over pages of elements - * $pagedResponse = $serviceMonitoringServiceClient->listServices($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * - * - * // Alternatively: - * - * // Iterate through all elements - * $pagedResponse = $serviceMonitoringServiceClient->listServices($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } + * $formattedName = $serviceMonitoringServiceClient->serviceName('[PROJECT]', '[SERVICE]'); + * $serviceMonitoringServiceClient->deleteService($formattedName); * } finally { * $serviceMonitoringServiceClient->close(); * } * ``` * - * @param string $parent Required. Resource name of the parent containing the listed services, either a - * project or a Monitoring Workspace. The formats are: + * @param string $name Required. Resource name of the `Service` to delete. The format is: * - * projects/[PROJECT_ID_OR_NUMBER] - * workspaces/[HOST_PROJECT_ID_OR_NUMBER] - * @param array $optionalArgs { - * Optional. + * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] + * @param array $optionalArgs { + * Optional. * - * @type string $filter - * A filter specifying what `Service`s to return. The filter currently - * supports the following fields: - * - * - `identifier_case` - * - `app_engine.module_id` - * - `cloud_endpoints.service` - * - `cluster_istio.location` - * - `cluster_istio.cluster_name` - * - `cluster_istio.service_namespace` - * - `cluster_istio.service_name` - * - * `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", "CLOUD_ENDPOINTS", and "CLUSTER_ISTIO". - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * - * @return \Google\ApiCore\PagedListResponse - * * @throws ApiException if the remote call fails */ - public function listServices($parent, array $optionalArgs = []) + public function deleteService($name, array $optionalArgs = []) { - $request = new ListServicesRequest(); - $request->setParent($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([ - 'parent' => $request->getParent(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->getPagedListResponse( - 'ListServices', - $optionalArgs, - ListServicesResponse::class, - $request - ); + $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(); } /** - * Update this `Service`. + * Delete the given `ServiceLevelObjective`. * * Sample code: * ``` * $serviceMonitoringServiceClient = new ServiceMonitoringServiceClient(); * try { - * $service = new Service(); - * $response = $serviceMonitoringServiceClient->updateService($service); + * $formattedName = $serviceMonitoringServiceClient->serviceLevelObjectiveName('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]'); + * $serviceMonitoringServiceClient->deleteServiceLevelObjective($formattedName); * } 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. + * @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 FieldMask $updateMask - * A set of field paths defining which fields to use for the update. * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * - * @return \Google\Cloud\Monitoring\V3\Service - * * @throws ApiException if the remote call fails */ - public function updateService($service, array $optionalArgs = []) + public function deleteServiceLevelObjective($name, array $optionalArgs = []) { - $request = new UpdateServiceRequest(); - $request->setService($service); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor([ - 'service.name' => $request->getService()->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'UpdateService', - Service::class, - $optionalArgs, - $request - )->wait(); + $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(); } /** - * Soft delete this `Service`. + * Get the named `Service`. * * Sample code: * ``` * $serviceMonitoringServiceClient = new ServiceMonitoringServiceClient(); * try { * $formattedName = $serviceMonitoringServiceClient->serviceName('[PROJECT]', '[SERVICE]'); - * $serviceMonitoringServiceClient->deleteService($formattedName); + * $response = $serviceMonitoringServiceClient->getService($formattedName); * } finally { * $serviceMonitoringServiceClient->close(); * } * ``` * - * @param string $name Required. Resource name of the `Service` to delete. The format is: + * @param string $name Required. Resource name of the `Service`. The format is: * - * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] - * @param array $optionalArgs { - * Optional. + * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] + * @param array $optionalArgs { + * Optional. * * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * + * @return \Google\Cloud\Monitoring\V3\Service + * * @throws ApiException if the remote call fails */ - public function deleteService($name, array $optionalArgs = []) + public function getService($name, array $optionalArgs = []) { - $request = new DeleteServiceRequest(); + $request = new GetServiceRequest(); + $requestParamHeaders = []; $request->setName($name); - - $requestParams = new RequestParamsHeaderDescriptor([ - 'name' => $request->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'DeleteService', - GPBEmpty::class, - $optionalArgs, - $request - )->wait(); + $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(); } /** - * Create a `ServiceLevelObjective` for the given `Service`. + * Get a `ServiceLevelObjective` by name. * * Sample code: * ``` * $serviceMonitoringServiceClient = new ServiceMonitoringServiceClient(); * try { - * $formattedParent = $serviceMonitoringServiceClient->serviceName('[PROJECT]', '[SERVICE]'); - * $serviceLevelObjective = new ServiceLevelObjective(); - * $response = $serviceMonitoringServiceClient->createServiceLevelObjective($formattedParent, $serviceLevelObjective); + * $formattedName = $serviceMonitoringServiceClient->serviceLevelObjectiveName('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]'); + * $response = $serviceMonitoringServiceClient->getServiceLevelObjective($formattedName); * } finally { * $serviceMonitoringServiceClient->close(); * } * ``` * - * @param string $parent Required. Resource name of the parent `Service`. 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] - * @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. + * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjectives/[SLO_NAME] + * @param array $optionalArgs { + * Optional. * - * @type string $serviceLevelObjectiveId - * Optional. The ServiceLevelObjective id to use for this - * ServiceLevelObjective. If omitted, an id will be generated instead. Must - * match the pattern `[a-z0-9\-]+` + * @type int $view + * View of the `ServiceLevelObjective` to return. If `DEFAULT`, return the + * `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the + * `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the + * `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed. + * For allowed values, use constants defined on {@see \Google\Cloud\Monitoring\V3\ServiceLevelObjective\View} * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * * @return \Google\Cloud\Monitoring\V3\ServiceLevelObjective * * @throws ApiException if the remote call fails */ - public function createServiceLevelObjective($parent, $serviceLevelObjective, array $optionalArgs = []) + public function getServiceLevelObjective($name, array $optionalArgs = []) { - $request = new CreateServiceLevelObjectiveRequest(); - $request->setParent($parent); - $request->setServiceLevelObjective($serviceLevelObjective); - if (isset($optionalArgs['serviceLevelObjectiveId'])) { - $request->setServiceLevelObjectiveId($optionalArgs['serviceLevelObjectiveId']); + $request = new GetServiceLevelObjectiveRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['view'])) { + $request->setView($optionalArgs['view']); } - $requestParams = new RequestParamsHeaderDescriptor([ - 'parent' => $request->getParent(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'CreateServiceLevelObjective', - ServiceLevelObjective::class, - $optionalArgs, - $request - )->wait(); + $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(); } /** - * Get a `ServiceLevelObjective` by name. + * List the `ServiceLevelObjective`s for the given `Service`. * * Sample code: * ``` * $serviceMonitoringServiceClient = new ServiceMonitoringServiceClient(); * try { - * $formattedName = $serviceMonitoringServiceClient->serviceLevelObjectiveName('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]'); - * $response = $serviceMonitoringServiceClient->getServiceLevelObjective($formattedName); + * $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 $name Required. Resource name of the `ServiceLevelObjective` to get. The format is: + * @param string $parent Required. Resource name of the parent containing the listed SLOs, either a + * project or a Monitoring Workspace. The formats are: * - * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjectives/[SLO_NAME] - * @param array $optionalArgs { - * Optional. + * 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` 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} + * View of the `ServiceLevelObjective`s to return. If `DEFAULT`, return each + * `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the + * `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the + * `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed. + * For allowed values, use constants defined on {@see \Google\Cloud\Monitoring\V3\ServiceLevelObjective\View} * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * - * @return \Google\Cloud\Monitoring\V3\ServiceLevelObjective + * @return \Google\ApiCore\PagedListResponse * * @throws ApiException if the remote call fails */ - public function getServiceLevelObjective($name, array $optionalArgs = []) + public function listServiceLevelObjectives($parent, array $optionalArgs = []) { - $request = new GetServiceLevelObjectiveRequest(); - $request->setName($name); + $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([ - 'name' => $request->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'GetServiceLevelObjective', - ServiceLevelObjective::class, - $optionalArgs, - $request - )->wait(); + $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 the `ServiceLevelObjective`s for the given `Service`. + * List `Service`s for this workspace. * * Sample code: * ``` * $serviceMonitoringServiceClient = new ServiceMonitoringServiceClient(); * try { - * $formattedParent = $serviceMonitoringServiceClient->serviceName('[PROJECT]', '[SERVICE]'); + * $parent = 'parent'; * // Iterate over pages of elements - * $pagedResponse = $serviceMonitoringServiceClient->listServiceLevelObjectives($formattedParent); + * $pagedResponse = $serviceMonitoringServiceClient->listServices($parent); * foreach ($pagedResponse->iteratePages() as $page) { * foreach ($page as $element) { * // doSomethingWith($element); * } * } - * - * * // Alternatively: - * * // Iterate through all elements - * $pagedResponse = $serviceMonitoringServiceClient->listServiceLevelObjectives($formattedParent); + * $pagedResponse = $serviceMonitoringServiceClient->listServices($parent); * foreach ($pagedResponse->iterateAllElements() as $element) { * // doSomethingWith($element); * } @@ -795,175 +889,169 @@ 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: + * @param string $parent Required. Resource name of the parent containing the listed services, either a + * [project](https://cloud.google.com/monitoring/api/v3#project_name) or a + * Monitoring Workspace. The formats are: * - * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] - * workspaces/[HOST_PROJECT_ID_OR_NUMBER]/services/- - * @param array $optionalArgs { - * Optional. + * projects/[PROJECT_ID_OR_NUMBER] + * workspaces/[HOST_PROJECT_ID_OR_NUMBER] + * @param array $optionalArgs { + * Optional. * * @type string $filter - * A filter specifying what `ServiceLevelObjective`s to return. + * A filter specifying what `Service`s to return. The filter currently + * supports the following fields: + * + * - `identifier_case` + * - `app_engine.module_id` + * - `cloud_endpoints.service` (reserved for future use) + * - `mesh_istio.mesh_uid` + * - `mesh_istio.service_namespace` + * - `mesh_istio.service_name` + * - `cluster_istio.location` (deprecated) + * - `cluster_istio.cluster_name` (deprecated) + * - `cluster_istio.service_namespace` (deprecated) + * - `cluster_istio.service_name` (deprecated) + * + * `identifier_case` refers to which option in the identifier oneof is + * populated. For example, the filter `identifier_case = "CUSTOM"` would match + * all services with a value for the `custom` field. Valid options are + * "CUSTOM", "APP_ENGINE", "MESH_ISTIO", plus "CLUSTER_ISTIO" (deprecated) + * and "CLOUD_ENDPOINTS" (reserved for future use). * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. + * 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} + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * * @return \Google\ApiCore\PagedListResponse * * @throws ApiException if the remote call fails */ - public function listServiceLevelObjectives($parent, array $optionalArgs = []) + public function listServices($parent, array $optionalArgs = []) { - $request = new ListServiceLevelObjectivesRequest(); + $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']); } - if (isset($optionalArgs['view'])) { - $request->setView($optionalArgs['view']); - } - $requestParams = new RequestParamsHeaderDescriptor([ - 'parent' => $request->getParent(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->getPagedListResponse( - 'ListServiceLevelObjectives', - $optionalArgs, - ListServiceLevelObjectivesResponse::class, - $request - ); + $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 the given `ServiceLevelObjective`. + * Update this `Service`. * * Sample code: * ``` * $serviceMonitoringServiceClient = new ServiceMonitoringServiceClient(); * try { - * $serviceLevelObjective = new ServiceLevelObjective(); - * $response = $serviceMonitoringServiceClient->updateServiceLevelObjective($serviceLevelObjective); + * $service = new Service(); + * $response = $serviceMonitoringServiceClient->updateService($service); * } 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. + * @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. + * A set of field paths defining which fields to use for the update. * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * - * @return \Google\Cloud\Monitoring\V3\ServiceLevelObjective + * @return \Google\Cloud\Monitoring\V3\Service * * @throws ApiException if the remote call fails */ - public function updateServiceLevelObjective($serviceLevelObjective, array $optionalArgs = []) + public function updateService($service, array $optionalArgs = []) { - $request = new UpdateServiceLevelObjectiveRequest(); - $request->setServiceLevelObjective($serviceLevelObjective); + $request = new UpdateServiceRequest(); + $requestParamHeaders = []; + $request->setService($service); + $requestParamHeaders['service.name'] = $service->getName(); if (isset($optionalArgs['updateMask'])) { $request->setUpdateMask($optionalArgs['updateMask']); } - $requestParams = new RequestParamsHeaderDescriptor([ - 'service_level_objective.name' => $request->getServiceLevelObjective()->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'UpdateServiceLevelObjective', - ServiceLevelObjective::class, - $optionalArgs, - $request - )->wait(); + $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(); } /** - * Delete the given `ServiceLevelObjective`. + * Update the given `ServiceLevelObjective`. * * Sample code: * ``` * $serviceMonitoringServiceClient = new ServiceMonitoringServiceClient(); * try { - * $formattedName = $serviceMonitoringServiceClient->serviceLevelObjectiveName('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]'); - * $serviceMonitoringServiceClient->deleteServiceLevelObjective($formattedName); + * $serviceLevelObjective = new ServiceLevelObjective(); + * $response = $serviceMonitoringServiceClient->updateServiceLevelObjective($serviceLevelObjective); * } 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. + * @param ServiceLevelObjective $serviceLevelObjective Required. The `ServiceLevelObjective` to draw updates from. + * The given `name` specifies the resource to update. + * @param array $optionalArgs { + * Optional. * + * @type FieldMask $updateMask + * A set of field paths defining which fields to use for the update. * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * + * @return \Google\Cloud\Monitoring\V3\ServiceLevelObjective + * * @throws ApiException if the remote call fails */ - public function deleteServiceLevelObjective($name, array $optionalArgs = []) + public function updateServiceLevelObjective($serviceLevelObjective, array $optionalArgs = []) { - $request = new DeleteServiceLevelObjectiveRequest(); - $request->setName($name); + $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([ - 'name' => $request->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'DeleteServiceLevelObjective', - GPBEmpty::class, - $optionalArgs, - $request - )->wait(); + $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/Monitoring/src/V3/Gapic/UptimeCheckServiceGapicClient.php b/Monitoring/src/V3/Gapic/UptimeCheckServiceGapicClient.php index c9fb5a27ecd..02f2dacce18 100644 --- a/Monitoring/src/V3/Gapic/UptimeCheckServiceGapicClient.php +++ b/Monitoring/src/V3/Gapic/UptimeCheckServiceGapicClient.php @@ -17,9 +17,9 @@ /* * GENERATED CODE WARNING - * This file was generated from the file - * https://github.com/google/googleapis/blob/master/google/monitoring/v3/uptime_service.proto - * and updates to that file get reflected here through a refresh process. + * Generated by gapic-generator-php from the file + * https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/uptime_service.proto + * Updates to the above are reflected here through a refresh process. */ namespace Google\Cloud\Monitoring\V3\Gapic; @@ -27,6 +27,7 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; + use Google\ApiCore\PathTemplate; use Google\ApiCore\RequestParamsHeaderDescriptor; use Google\ApiCore\RetrySettings; @@ -61,32 +62,18 @@ * ``` * $uptimeCheckServiceClient = new Google\Cloud\Monitoring\V3\UptimeCheckServiceClient(); * try { - * $formattedParent = $uptimeCheckServiceClient->projectName('[PROJECT]'); - * // Iterate over pages of elements - * $pagedResponse = $uptimeCheckServiceClient->listUptimeCheckConfigs($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * - * - * // Alternatively: - * - * // Iterate through all elements - * $pagedResponse = $uptimeCheckServiceClient->listUptimeCheckConfigs($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } + * $parent = 'parent'; + * $uptimeCheckConfig = new Google\Cloud\Monitoring\V3\UptimeCheckConfig(); + * $response = $uptimeCheckServiceClient->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. + * Many parameters require resource names to be formatted in a particular way. To + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. */ class UptimeCheckServiceGapicClient { @@ -119,43 +106,67 @@ class UptimeCheckServiceGapicClient '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 $projectNameTemplate; + + 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', + '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' => [ - 'scopes' => self::$serviceScopes, + 'defaultScopes' => self::$serviceScopes, ], 'transportConfig' => [ 'rest' => [ - 'restClientConfigPath' => __DIR__.'/../resources/uptime_check_service_rest_client_config.php', + 'restClientConfigPath' => __DIR__ . '/../resources/uptime_check_service_rest_client_config.php', ], ], ]; } - private static function getProjectNameTemplate() + 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 (null == self::$projectNameTemplate) { - self::$projectNameTemplate = new PathTemplate('projects/{project}'); + if (self::$projectUptimeCheckConfigNameTemplate == null) { + self::$projectUptimeCheckConfigNameTemplate = new PathTemplate('projects/{project}/uptimeCheckConfigs/{uptime_check_config}'); } - return self::$projectNameTemplate; + return self::$projectUptimeCheckConfigNameTemplate; } private static function getUptimeCheckConfigNameTemplate() { - if (null == self::$uptimeCheckConfigNameTemplate) { + if (self::$uptimeCheckConfigNameTemplate == null) { self::$uptimeCheckConfigNameTemplate = new PathTemplate('projects/{project}/uptimeCheckConfigs/{uptime_check_config}'); } @@ -164,9 +175,11 @@ private static function getUptimeCheckConfigNameTemplate() private static function getPathTemplateMap() { - if (null == self::$pathTemplateMap) { + if (self::$pathTemplateMap == null) { self::$pathTemplateMap = [ - 'project' => self::getProjectNameTemplate(), + 'folderUptimeCheckConfig' => self::getFolderUptimeCheckConfigNameTemplate(), + 'organizationUptimeCheckConfig' => self::getOrganizationUptimeCheckConfigNameTemplate(), + 'projectUptimeCheckConfig' => self::getProjectUptimeCheckConfigNameTemplate(), 'uptimeCheckConfig' => self::getUptimeCheckConfigNameTemplate(), ]; } @@ -175,23 +188,59 @@ private static function getPathTemplateMap() } /** - * Formats a string containing the fully-qualified path to represent - * a project resource. + * 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 resource. + * @return string The formatted project_uptime_check_config resource. */ - public static function projectName($project) + public static function projectUptimeCheckConfigName($project, $uptimeCheckConfig) { - return self::getProjectNameTemplate()->render([ + 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. + * Formats a string containing the fully-qualified path to represent a + * uptime_check_config resource. * * @param string $project * @param string $uptimeCheckConfig @@ -210,13 +259,16 @@ public static function uptimeCheckConfigName($project, $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 - * - project: projects/{project} - * - uptimeCheckConfig: projects/{project}/uptimeCheckConfigs/{uptime_check_config}. + * - 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. + * 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 @@ -228,7 +280,6 @@ public static function uptimeCheckConfigName($project, $uptimeCheckConfig) 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"); @@ -244,6 +295,7 @@ public static function parseName($formattedName, $template = null) // Swallow the exception to continue trying other path templates } } + throw new ValidationException("Input did not match any known format. Input: $formattedName"); } @@ -251,7 +303,7 @@ public static function parseName($formattedName, $template = null) * Constructor. * * @param array $options { - * Optional. Options for configuring the service API wrapper. + * Optional. Options for configuring the service API wrapper. * * @type string $serviceAddress * **Deprecated**. This option will be removed in a future major release. Please @@ -268,35 +320,38 @@ public static function parseName($formattedName, $template = null) * {@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()}. + * 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. + * 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. + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $serviceAddress setting, will be ignored. * @type array $transportConfig * Configuration options that will be used to construct the transport. Options for * each supported transport type should be passed in a key for that transport. For * example: * $transportConfig = [ * 'grpc' => [...], - * 'rest' => [...] + * '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 @@ -308,315 +363,210 @@ public function __construct(array $options = []) } /** - * Lists the existing valid Uptime check configurations for the project - * (leaving out any invalid configurations). + * Creates a new Uptime check configuration. * * Sample code: * ``` * $uptimeCheckServiceClient = new Google\Cloud\Monitoring\V3\UptimeCheckServiceClient(); * try { - * $formattedParent = $uptimeCheckServiceClient->projectName('[PROJECT]'); - * // Iterate over pages of elements - * $pagedResponse = $uptimeCheckServiceClient->listUptimeCheckConfigs($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * - * - * // Alternatively: - * - * // Iterate through all elements - * $pagedResponse = $uptimeCheckServiceClient->listUptimeCheckConfigs($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } + * $parent = 'parent'; + * $uptimeCheckConfig = new Google\Cloud\Monitoring\V3\UptimeCheckConfig(); + * $response = $uptimeCheckServiceClient->createUptimeCheckConfig($parent, $uptimeCheckConfig); * } finally { * $uptimeCheckServiceClient->close(); * } * ``` * - * @param string $parent Required. The project whose Uptime check configurations are listed. The format is: + * @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 array $optionalArgs { - * Optional. + * projects/[PROJECT_ID_OR_NUMBER] + * @param UptimeCheckConfig $uptimeCheckConfig Required. The new Uptime check configuration. + * @param array $optionalArgs { + * Optional. * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * - * @return \Google\ApiCore\PagedListResponse + * @return \Google\Cloud\Monitoring\V3\UptimeCheckConfig * * @throws ApiException if the remote call fails */ - public function listUptimeCheckConfigs($parent, array $optionalArgs = []) + public function createUptimeCheckConfig($parent, $uptimeCheckConfig, array $optionalArgs = []) { - $request = new ListUptimeCheckConfigsRequest(); + $request = new CreateUptimeCheckConfigRequest(); + $requestParamHeaders = []; $request->setParent($parent); - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor([ - 'parent' => $request->getParent(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->getPagedListResponse( - 'ListUptimeCheckConfigs', - $optionalArgs, - ListUptimeCheckConfigsResponse::class, - $request - ); + $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(); } /** - * Gets a single Uptime check configuration. + * 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 Google\Cloud\Monitoring\V3\UptimeCheckServiceClient(); * try { * $formattedName = $uptimeCheckServiceClient->uptimeCheckConfigName('[PROJECT]', '[UPTIME_CHECK_CONFIG]'); - * $response = $uptimeCheckServiceClient->getUptimeCheckConfig($formattedName); + * $uptimeCheckServiceClient->deleteUptimeCheckConfig($formattedName); * } finally { * $uptimeCheckServiceClient->close(); * } * ``` * - * @param string $name Required. The Uptime check configuration to retrieve. The format is: + * @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. + * projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID] + * @param array $optionalArgs { + * Optional. * * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * - * @return \Google\Cloud\Monitoring\V3\UptimeCheckConfig - * * @throws ApiException if the remote call fails */ - public function getUptimeCheckConfig($name, array $optionalArgs = []) + public function deleteUptimeCheckConfig($name, array $optionalArgs = []) { - $request = new GetUptimeCheckConfigRequest(); + $request = new DeleteUptimeCheckConfigRequest(); + $requestParamHeaders = []; $request->setName($name); - - $requestParams = new RequestParamsHeaderDescriptor([ - 'name' => $request->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'GetUptimeCheckConfig', - UptimeCheckConfig::class, - $optionalArgs, - $request - )->wait(); + $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(); } /** - * Creates a new Uptime check configuration. + * Gets a single Uptime check configuration. * * Sample code: * ``` * $uptimeCheckServiceClient = new Google\Cloud\Monitoring\V3\UptimeCheckServiceClient(); * try { - * $formattedParent = $uptimeCheckServiceClient->projectName('[PROJECT]'); - * $uptimeCheckConfig = new Google\Cloud\Monitoring\V3\UptimeCheckConfig(); - * $response = $uptimeCheckServiceClient->createUptimeCheckConfig($formattedParent, $uptimeCheckConfig); + * $formattedName = $uptimeCheckServiceClient->uptimeCheckConfigName('[PROJECT]', '[UPTIME_CHECK_CONFIG]'); + * $response = $uptimeCheckServiceClient->getUptimeCheckConfig($formattedName); * } finally { * $uptimeCheckServiceClient->close(); * } * ``` * - * @param string $parent Required. The project in which to create the Uptime check. The format is: + * @param string $name Required. The Uptime check configuration to retrieve. The format is: * - * projects/[PROJECT_ID_OR_NUMBER] - * @param UptimeCheckConfig $uptimeCheckConfig Required. The new Uptime check configuration. - * @param array $optionalArgs { - * Optional. + * projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID] + * @param array $optionalArgs { + * Optional. * * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * * @return \Google\Cloud\Monitoring\V3\UptimeCheckConfig * * @throws ApiException if the remote call fails */ - public function createUptimeCheckConfig($parent, $uptimeCheckConfig, array $optionalArgs = []) + public function getUptimeCheckConfig($name, array $optionalArgs = []) { - $request = new CreateUptimeCheckConfigRequest(); - $request->setParent($parent); - $request->setUptimeCheckConfig($uptimeCheckConfig); - - $requestParams = new RequestParamsHeaderDescriptor([ - 'parent' => $request->getParent(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'CreateUptimeCheckConfig', - UptimeCheckConfig::class, - $optionalArgs, - $request - )->wait(); + $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(); } /** - * 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. + * Lists the existing valid Uptime check configurations for the project + * (leaving out any invalid configurations). * * Sample code: * ``` * $uptimeCheckServiceClient = new Google\Cloud\Monitoring\V3\UptimeCheckServiceClient(); * try { - * $uptimeCheckConfig = new Google\Cloud\Monitoring\V3\UptimeCheckConfig(); - * $response = $uptimeCheckServiceClient->updateUptimeCheckConfig($uptimeCheckConfig); + * $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 UptimeCheckConfig $uptimeCheckConfig Required. If an `updateMask` has been specified, this field gives - * the values for the set of fields mentioned in the `updateMask`. If an - * `updateMask` has not been given, this Uptime check configuration replaces - * the current configuration. If a field is mentioned in `updateMask` but - * the corresonding field is omitted in this partial Uptime check - * configuration, it has the effect of deleting/clearing the field from the - * configuration on the server. + * @param string $parent Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) + * whose Uptime check configurations are listed. The format is: * - * The following fields can be updated: `display_name`, - * `http_check`, `tcp_check`, `timeout`, `content_matchers`, and - * `selected_regions`. - * @param array $optionalArgs { - * Optional. + * projects/[PROJECT_ID_OR_NUMBER] + * @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 int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * - * @return \Google\Cloud\Monitoring\V3\UptimeCheckConfig + * @return \Google\ApiCore\PagedListResponse * * @throws ApiException if the remote call fails */ - public function updateUptimeCheckConfig($uptimeCheckConfig, array $optionalArgs = []) + public function listUptimeCheckConfigs($parent, array $optionalArgs = []) { - $request = new UpdateUptimeCheckConfigRequest(); - $request->setUptimeCheckConfig($uptimeCheckConfig); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); + $request = new ListUptimeCheckConfigsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); } - $requestParams = new RequestParamsHeaderDescriptor([ - 'uptime_check_config.name' => $request->getUptimeCheckConfig()->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'UpdateUptimeCheckConfig', - 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 Google\Cloud\Monitoring\V3\UptimeCheckServiceClient(); - * try { - * $formattedName = $uptimeCheckServiceClient->uptimeCheckConfigName('[PROJECT]', '[UPTIME_CHECK_CONFIG]'); - * $uptimeCheckServiceClient->deleteUptimeCheckConfig($formattedName); - * } finally { - * $uptimeCheckServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The Uptime check configuration to delete. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID] - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - */ - public function deleteUptimeCheckConfig($name, array $optionalArgs = []) - { - $request = new DeleteUptimeCheckConfigRequest(); - $request->setName($name); + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } - $requestParams = new RequestParamsHeaderDescriptor([ - 'name' => $request->getName(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->startCall( - 'DeleteUptimeCheckConfig', - GPBEmpty::class, - $optionalArgs, - $request - )->wait(); + $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. + * Returns the list of IP addresses that checkers run from * * Sample code: * ``` @@ -629,10 +579,7 @@ public function deleteUptimeCheckConfig($name, array $optionalArgs = []) * // doSomethingWith($element); * } * } - * - * * // Alternatively: - * * // Iterate through all elements * $pagedResponse = $uptimeCheckServiceClient->listUptimeCheckIps(); * foreach ($pagedResponse->iterateAllElements() as $element) { @@ -644,22 +591,22 @@ public function deleteUptimeCheckConfig($name, array $optionalArgs = []) * ``` * * @param array $optionalArgs { - * Optional. + * 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. + * 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. + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. * } * * @return \Google\ApiCore\PagedListResponse @@ -672,15 +619,73 @@ public function listUptimeCheckIps(array $optionalArgs = []) if (isset($optionalArgs['pageSize'])) { $request->setPageSize($optionalArgs['pageSize']); } + if (isset($optionalArgs['pageToken'])) { $request->setPageToken($optionalArgs['pageToken']); } - return $this->getPagedListResponse( - 'ListUptimeCheckIps', - $optionalArgs, - ListUptimeCheckIpsResponse::class, - $request - ); + 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 Google\Cloud\Monitoring\V3\UptimeCheckServiceClient(); + * try { + * $uptimeCheckConfig = new Google\Cloud\Monitoring\V3\UptimeCheckConfig(); + * $response = $uptimeCheckServiceClient->updateUptimeCheckConfig($uptimeCheckConfig); + * } finally { + * $uptimeCheckServiceClient->close(); + * } + * ``` + * + * @param UptimeCheckConfig $uptimeCheckConfig Required. If an `updateMask` has been specified, this field gives + * the values for the set of fields mentioned in the `updateMask`. If an + * `updateMask` has not been given, this Uptime check configuration replaces + * the current configuration. If a field is mentioned in `updateMask` but + * the corresonding field is omitted in this partial Uptime check + * configuration, it has the effect of deleting/clearing the field from the + * configuration on the server. + * + * The following fields can be updated: `display_name`, + * `http_check`, `tcp_check`, `timeout`, `content_matchers`, and + * `selected_regions`. + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * Optional. If present, only the listed fields in the current Uptime check + * configuration are updated with values from the new configuration. If this + * field is empty, then the current configuration is completely replaced with + * the new configuration. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Monitoring\V3\UptimeCheckConfig + * + * @throws ApiException if the remote call fails + */ + public function updateUptimeCheckConfig($uptimeCheckConfig, array $optionalArgs = []) + { + $request = new UpdateUptimeCheckConfigRequest(); + $requestParamHeaders = []; + $request->setUptimeCheckConfig($uptimeCheckConfig); + $requestParamHeaders['uptime_check_config.name'] = $uptimeCheckConfig->getName(); + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('UpdateUptimeCheckConfig', UptimeCheckConfig::class, $optionalArgs, $request)->wait(); } } diff --git a/Monitoring/src/V3/GetNotificationChannelVerificationCodeRequest.php b/Monitoring/src/V3/GetNotificationChannelVerificationCodeRequest.php index 884284ce3cb..ad026e8f59e 100644 --- a/Monitoring/src/V3/GetNotificationChannelVerificationCodeRequest.php +++ b/Monitoring/src/V3/GetNotificationChannelVerificationCodeRequest.php @@ -107,13 +107,23 @@ public function setName($var) * 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 + * @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; diff --git a/Monitoring/src/V3/GetNotificationChannelVerificationCodeResponse.php b/Monitoring/src/V3/GetNotificationChannelVerificationCodeResponse.php index f0423fa931e..43e578d3a49 100644 --- a/Monitoring/src/V3/GetNotificationChannelVerificationCodeResponse.php +++ b/Monitoring/src/V3/GetNotificationChannelVerificationCodeResponse.php @@ -93,13 +93,23 @@ public function setCode($var) * requested expiration in the request and the max permitted expiration. * * Generated from protobuf field .google.protobuf.Timestamp expire_time = 2; - * @return \Google\Protobuf\Timestamp + * @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 diff --git a/Monitoring/src/V3/GetServiceLevelObjectiveRequest.php b/Monitoring/src/V3/GetServiceLevelObjectiveRequest.php index 99979530d87..09c873393d2 100644 --- a/Monitoring/src/V3/GetServiceLevelObjectiveRequest.php +++ b/Monitoring/src/V3/GetServiceLevelObjectiveRequest.php @@ -107,7 +107,7 @@ public function getView() */ public function setView($var) { - GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\ServiceLevelObjective_View::class); + GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\ServiceLevelObjective\View::class); $this->view = $var; return $this; diff --git a/Monitoring/src/V3/GroupServiceClient.php b/Monitoring/src/V3/GroupServiceClient.php index ba0a7943649..0c5c992a404 100644 --- a/Monitoring/src/V3/GroupServiceClient.php +++ b/Monitoring/src/V3/GroupServiceClient.php @@ -17,20 +17,18 @@ /* * GENERATED CODE WARNING - * This file was generated from the file - * https://github.com/google/googleapis/blob/master/google/monitoring/v3/group_service.proto - * and updates to that file get reflected here through a refresh process. + * Generated by gapic-generator-php from the file + * https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/group_service.proto + * Updates to the above are reflected here through a refresh process. */ namespace Google\Cloud\Monitoring\V3; use Google\Cloud\Monitoring\V3\Gapic\GroupServiceGapicClient; -/** - * {@inheritdoc} - */ +/** {@inheritdoc} */ class GroupServiceClient extends GroupServiceGapicClient { - // This class is intentionally empty, and is intended to hold manual - // additions to the generated {@see GroupServiceGapicClient} class. + // This class is intentionally empty, and is intended to hold manual additions to + // the generated {@see GroupServiceGapicClient} class. } diff --git a/Monitoring/src/V3/GroupServiceGrpcClient.php b/Monitoring/src/V3/GroupServiceGrpcClient.php index 771b5426292..f1971d59247 100644 --- a/Monitoring/src/V3/GroupServiceGrpcClient.php +++ b/Monitoring/src/V3/GroupServiceGrpcClient.php @@ -48,6 +48,7 @@ public function __construct($hostname, $opts, $channel = null) { * @param \Google\Cloud\Monitoring\V3\ListGroupsRequest $argument input argument * @param array $metadata metadata * @param array $options call options + * @return \Grpc\UnaryCall */ public function ListGroups(\Google\Cloud\Monitoring\V3\ListGroupsRequest $argument, $metadata = [], $options = []) { @@ -62,6 +63,7 @@ public function ListGroups(\Google\Cloud\Monitoring\V3\ListGroupsRequest $argume * @param \Google\Cloud\Monitoring\V3\GetGroupRequest $argument input argument * @param array $metadata metadata * @param array $options call options + * @return \Grpc\UnaryCall */ public function GetGroup(\Google\Cloud\Monitoring\V3\GetGroupRequest $argument, $metadata = [], $options = []) { @@ -76,6 +78,7 @@ public function GetGroup(\Google\Cloud\Monitoring\V3\GetGroupRequest $argument, * @param \Google\Cloud\Monitoring\V3\CreateGroupRequest $argument input argument * @param array $metadata metadata * @param array $options call options + * @return \Grpc\UnaryCall */ public function CreateGroup(\Google\Cloud\Monitoring\V3\CreateGroupRequest $argument, $metadata = [], $options = []) { @@ -91,6 +94,7 @@ public function CreateGroup(\Google\Cloud\Monitoring\V3\CreateGroupRequest $argu * @param \Google\Cloud\Monitoring\V3\UpdateGroupRequest $argument input argument * @param array $metadata metadata * @param array $options call options + * @return \Grpc\UnaryCall */ public function UpdateGroup(\Google\Cloud\Monitoring\V3\UpdateGroupRequest $argument, $metadata = [], $options = []) { @@ -105,6 +109,7 @@ public function UpdateGroup(\Google\Cloud\Monitoring\V3\UpdateGroupRequest $argu * @param \Google\Cloud\Monitoring\V3\DeleteGroupRequest $argument input argument * @param array $metadata metadata * @param array $options call options + * @return \Grpc\UnaryCall */ public function DeleteGroup(\Google\Cloud\Monitoring\V3\DeleteGroupRequest $argument, $metadata = [], $options = []) { @@ -119,6 +124,7 @@ public function DeleteGroup(\Google\Cloud\Monitoring\V3\DeleteGroupRequest $argu * @param \Google\Cloud\Monitoring\V3\ListGroupMembersRequest $argument input argument * @param array $metadata metadata * @param array $options call options + * @return \Grpc\UnaryCall */ public function ListGroupMembers(\Google\Cloud\Monitoring\V3\ListGroupMembersRequest $argument, $metadata = [], $options = []) { diff --git a/Monitoring/src/V3/InternalChecker.php b/Monitoring/src/V3/InternalChecker.php index 9db617dd42c..99552b07193 100644 --- a/Monitoring/src/V3/InternalChecker.php +++ b/Monitoring/src/V3/InternalChecker.php @@ -260,7 +260,7 @@ public function getState() */ public function setState($var) { - GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\InternalChecker_State::class); + GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\InternalChecker\State::class); $this->state = $var; return $this; diff --git a/Monitoring/src/V3/LabelValue.php b/Monitoring/src/V3/LabelValue.php index ee2f5ab9cc6..3a66a26a435 100644 --- a/Monitoring/src/V3/LabelValue.php +++ b/Monitoring/src/V3/LabelValue.php @@ -47,6 +47,11 @@ public function getBoolValue() return $this->readOneof(1); } + public function hasBoolValue() + { + return $this->hasOneof(1); + } + /** * A bool label value. * @@ -73,6 +78,11 @@ public function getInt64Value() return $this->readOneof(2); } + public function hasInt64Value() + { + return $this->hasOneof(2); + } + /** * An int64 label value. * @@ -99,6 +109,11 @@ public function getStringValue() return $this->readOneof(3); } + public function hasStringValue() + { + return $this->hasOneof(3); + } + /** * A string label value. * diff --git a/Monitoring/src/V3/ListAlertPoliciesRequest.php b/Monitoring/src/V3/ListAlertPoliciesRequest.php index 95a9d61df70..6e81de4f6a4 100644 --- a/Monitoring/src/V3/ListAlertPoliciesRequest.php +++ b/Monitoring/src/V3/ListAlertPoliciesRequest.php @@ -16,7 +16,8 @@ class ListAlertPoliciesRequest extends \Google\Protobuf\Internal\Message { /** - * Required. The project whose alert policies are to be listed. The format is: + * 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 @@ -68,7 +69,8 @@ class ListAlertPoliciesRequest extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $name - * Required. The project whose alert policies are to be listed. The format is: + * 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 @@ -100,7 +102,8 @@ public function __construct($data = NULL) { } /** - * Required. The project whose alert policies are to be listed. The format is: + * 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 @@ -117,7 +120,8 @@ public function getName() } /** - * Required. The project whose alert policies are to be listed. The format is: + * 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 diff --git a/Monitoring/src/V3/ListAlertPoliciesResponse.php b/Monitoring/src/V3/ListAlertPoliciesResponse.php index 7c584632603..770d6f79a9d 100644 --- a/Monitoring/src/V3/ListAlertPoliciesResponse.php +++ b/Monitoring/src/V3/ListAlertPoliciesResponse.php @@ -29,6 +29,13 @@ class ListAlertPoliciesResponse extends \Google\Protobuf\Internal\Message * Generated from protobuf field string next_page_token = 2; */ private $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; + */ + private $total_size = 0; /** * Constructor. @@ -42,6 +49,9 @@ class ListAlertPoliciesResponse extends \Google\Protobuf\Internal\Message * 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) { @@ -105,5 +115,33 @@ public function setNextPageToken($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/Monitoring/src/V3/ListGroupMembersRequest.php b/Monitoring/src/V3/ListGroupMembersRequest.php index 5b225944bd3..313adf431dd 100644 --- a/Monitoring/src/V3/ListGroupMembersRequest.php +++ b/Monitoring/src/V3/ListGroupMembersRequest.php @@ -222,13 +222,23 @@ public function setFilter($var) * membership over the last minute is returned. * * Generated from protobuf field .google.monitoring.v3.TimeInterval interval = 6; - * @return \Google\Cloud\Monitoring\V3\TimeInterval + * @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 diff --git a/Monitoring/src/V3/ListGroupsRequest.php b/Monitoring/src/V3/ListGroupsRequest.php index 2ac88671993..d9203b457d0 100644 --- a/Monitoring/src/V3/ListGroupsRequest.php +++ b/Monitoring/src/V3/ListGroupsRequest.php @@ -16,7 +16,8 @@ class ListGroupsRequest extends \Google\Protobuf\Internal\Message { /** - * Required. The project 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) = { @@ -45,7 +46,8 @@ class ListGroupsRequest extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $name - * Required. The project 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: @@ -79,7 +81,8 @@ public function __construct($data = NULL) { } /** - * Required. The project 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) = { @@ -91,7 +94,8 @@ public function getName() } /** - * Required. The project 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) = { @@ -120,6 +124,11 @@ 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] @@ -154,6 +163,11 @@ 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] @@ -189,6 +203,11 @@ 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] diff --git a/Monitoring/src/V3/ListMetricDescriptorsRequest.php b/Monitoring/src/V3/ListMetricDescriptorsRequest.php index ca6efe01c32..179cfa52241 100644 --- a/Monitoring/src/V3/ListMetricDescriptorsRequest.php +++ b/Monitoring/src/V3/ListMetricDescriptorsRequest.php @@ -16,7 +16,8 @@ class ListMetricDescriptorsRequest extends \Google\Protobuf\Internal\Message { /** - * Required. The project 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) = { @@ -56,7 +57,8 @@ class ListMetricDescriptorsRequest extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $name - * Required. The project 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 @@ -80,7 +82,8 @@ public function __construct($data = NULL) { } /** - * Required. The project 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) = { @@ -92,7 +95,8 @@ public function getName() } /** - * Required. The project 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/ListMonitoredResourceDescriptorsRequest.php b/Monitoring/src/V3/ListMonitoredResourceDescriptorsRequest.php index ea60efbc500..8cf91b962f0 100644 --- a/Monitoring/src/V3/ListMonitoredResourceDescriptorsRequest.php +++ b/Monitoring/src/V3/ListMonitoredResourceDescriptorsRequest.php @@ -16,7 +16,8 @@ class ListMonitoredResourceDescriptorsRequest extends \Google\Protobuf\Internal\Message { /** - * Required. The project 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) = { @@ -54,7 +55,8 @@ class ListMonitoredResourceDescriptorsRequest extends \Google\Protobuf\Internal\ * Optional. Data for populating the Message object. * * @type string $name - * Required. The project 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) @@ -76,7 +78,8 @@ public function __construct($data = NULL) { } /** - * Required. The project 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) = { @@ -88,7 +91,8 @@ public function getName() } /** - * Required. The project 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/ListNotificationChannelDescriptorsRequest.php b/Monitoring/src/V3/ListNotificationChannelDescriptorsRequest.php index f21fdfcadf1..3174f310040 100644 --- a/Monitoring/src/V3/ListNotificationChannelDescriptorsRequest.php +++ b/Monitoring/src/V3/ListNotificationChannelDescriptorsRequest.php @@ -19,8 +19,10 @@ class ListNotificationChannelDescriptorsRequest extends \Google\Protobuf\Interna * 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 the parent container in which to look for the - * descriptors; to retrieve a single descriptor by name, use the + * 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. * @@ -54,8 +56,10 @@ class ListNotificationChannelDescriptorsRequest extends \Google\Protobuf\Interna * 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 the parent container in which to look for the - * descriptors; to retrieve a single descriptor by name, use the + * 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 @@ -77,8 +81,10 @@ public function __construct($data = NULL) { * 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 the parent container in which to look for the - * descriptors; to retrieve a single descriptor by name, use the + * 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. * @@ -94,8 +100,10 @@ public function getName() * 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 the parent container in which to look for the - * descriptors; to retrieve a single descriptor by name, use the + * 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. * diff --git a/Monitoring/src/V3/ListNotificationChannelsRequest.php b/Monitoring/src/V3/ListNotificationChannelsRequest.php index f93e2f029db..61de5cfa15f 100644 --- a/Monitoring/src/V3/ListNotificationChannelsRequest.php +++ b/Monitoring/src/V3/ListNotificationChannelsRequest.php @@ -16,7 +16,8 @@ class ListNotificationChannelsRequest extends \Google\Protobuf\Internal\Message { /** - * Required. The project 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] * This names the container * in which to look for the notification channels; it does not name a @@ -71,7 +72,8 @@ class ListNotificationChannelsRequest extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $name - * Required. The project 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] * This names the container * in which to look for the notification channels; it does not name a @@ -106,7 +108,8 @@ public function __construct($data = NULL) { } /** - * Required. The project 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] * This names the container * in which to look for the notification channels; it does not name a @@ -124,7 +127,8 @@ public function getName() } /** - * Required. The project 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] * This names the container * in which to look for the notification channels; it does not name a diff --git a/Monitoring/src/V3/ListNotificationChannelsResponse.php b/Monitoring/src/V3/ListNotificationChannelsResponse.php index 551a50c0a31..07dbfe06731 100644 --- a/Monitoring/src/V3/ListNotificationChannelsResponse.php +++ b/Monitoring/src/V3/ListNotificationChannelsResponse.php @@ -30,6 +30,13 @@ class ListNotificationChannelsResponse extends \Google\Protobuf\Internal\Message * Generated from protobuf field string next_page_token = 2; */ private $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; + */ + private $total_size = 0; /** * Constructor. @@ -44,6 +51,9 @@ class ListNotificationChannelsResponse extends \Google\Protobuf\Internal\Message * 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) { @@ -109,5 +119,33 @@ public function setNextPageToken($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/Monitoring/src/V3/ListServiceLevelObjectivesRequest.php b/Monitoring/src/V3/ListServiceLevelObjectivesRequest.php index 6ed5e630c25..ea32fd24384 100644 --- a/Monitoring/src/V3/ListServiceLevelObjectivesRequest.php +++ b/Monitoring/src/V3/ListServiceLevelObjectivesRequest.php @@ -229,7 +229,7 @@ public function getView() */ public function setView($var) { - GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\ServiceLevelObjective_View::class); + GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\ServiceLevelObjective\View::class); $this->view = $var; return $this; diff --git a/Monitoring/src/V3/ListServicesRequest.php b/Monitoring/src/V3/ListServicesRequest.php index 05fb79a3d16..9689cd9be0d 100644 --- a/Monitoring/src/V3/ListServicesRequest.php +++ b/Monitoring/src/V3/ListServicesRequest.php @@ -17,7 +17,8 @@ class ListServicesRequest extends \Google\Protobuf\Internal\Message { /** * Required. Resource name of the parent containing the listed services, either a - * project or a Monitoring Workspace. The formats are: + * [project](https://cloud.google.com/monitoring/api/v3#project_name) or a + * Monitoring Workspace. The formats are: * projects/[PROJECT_ID_OR_NUMBER] * workspaces/[HOST_PROJECT_ID_OR_NUMBER] * @@ -29,15 +30,19 @@ class ListServicesRequest extends \Google\Protobuf\Internal\Message * supports the following fields: * - `identifier_case` * - `app_engine.module_id` - * - `cloud_endpoints.service` - * - `cluster_istio.location` - * - `cluster_istio.cluster_name` - * - `cluster_istio.service_namespace` - * - `cluster_istio.service_name` + * - `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", "CLOUD_ENDPOINTS", and "CLUSTER_ISTIO". + * "CUSTOM", "APP_ENGINE", "MESH_ISTIO", plus "CLUSTER_ISTIO" (deprecated) + * and "CLOUD_ENDPOINTS" (reserved for future use). * * Generated from protobuf field string filter = 2; */ @@ -66,7 +71,8 @@ class ListServicesRequest extends \Google\Protobuf\Internal\Message * * @type string $parent * Required. Resource name of the parent containing the listed services, either a - * project or a Monitoring Workspace. The formats are: + * [project](https://cloud.google.com/monitoring/api/v3#project_name) or a + * Monitoring Workspace. The formats are: * projects/[PROJECT_ID_OR_NUMBER] * workspaces/[HOST_PROJECT_ID_OR_NUMBER] * @type string $filter @@ -74,15 +80,19 @@ class ListServicesRequest extends \Google\Protobuf\Internal\Message * supports the following fields: * - `identifier_case` * - `app_engine.module_id` - * - `cloud_endpoints.service` - * - `cluster_istio.location` - * - `cluster_istio.cluster_name` - * - `cluster_istio.service_namespace` - * - `cluster_istio.service_name` + * - `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", "CLOUD_ENDPOINTS", and "CLUSTER_ISTIO". + * "CUSTOM", "APP_ENGINE", "MESH_ISTIO", plus "CLUSTER_ISTIO" (deprecated) + * and "CLOUD_ENDPOINTS" (reserved for future use). * @type int $page_size * A non-negative number that is the maximum number of results to return. * When 0, use default page size. @@ -99,7 +109,8 @@ public function __construct($data = NULL) { /** * Required. Resource name of the parent containing the listed services, either a - * project or a Monitoring Workspace. The formats are: + * [project](https://cloud.google.com/monitoring/api/v3#project_name) or a + * Monitoring Workspace. The formats are: * projects/[PROJECT_ID_OR_NUMBER] * workspaces/[HOST_PROJECT_ID_OR_NUMBER] * @@ -113,7 +124,8 @@ public function getParent() /** * Required. Resource name of the parent containing the listed services, either a - * project or a Monitoring Workspace. The formats are: + * [project](https://cloud.google.com/monitoring/api/v3#project_name) or a + * Monitoring Workspace. The formats are: * projects/[PROJECT_ID_OR_NUMBER] * workspaces/[HOST_PROJECT_ID_OR_NUMBER] * @@ -134,15 +146,19 @@ public function setParent($var) * supports the following fields: * - `identifier_case` * - `app_engine.module_id` - * - `cloud_endpoints.service` - * - `cluster_istio.location` - * - `cluster_istio.cluster_name` - * - `cluster_istio.service_namespace` - * - `cluster_istio.service_name` + * - `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", "CLOUD_ENDPOINTS", and "CLUSTER_ISTIO". + * "CUSTOM", "APP_ENGINE", "MESH_ISTIO", plus "CLUSTER_ISTIO" (deprecated) + * and "CLOUD_ENDPOINTS" (reserved for future use). * * Generated from protobuf field string filter = 2; * @return string @@ -157,15 +173,19 @@ public function getFilter() * supports the following fields: * - `identifier_case` * - `app_engine.module_id` - * - `cloud_endpoints.service` - * - `cluster_istio.location` - * - `cluster_istio.cluster_name` - * - `cluster_istio.service_namespace` - * - `cluster_istio.service_name` + * - `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", "CLOUD_ENDPOINTS", and "CLUSTER_ISTIO". + * "CUSTOM", "APP_ENGINE", "MESH_ISTIO", plus "CLUSTER_ISTIO" (deprecated) + * and "CLOUD_ENDPOINTS" (reserved for future use). * * Generated from protobuf field string filter = 2; * @param string $var diff --git a/Monitoring/src/V3/ListTimeSeriesRequest.php b/Monitoring/src/V3/ListTimeSeriesRequest.php index 91ee0744df0..2ccbd8dfb64 100644 --- a/Monitoring/src/V3/ListTimeSeriesRequest.php +++ b/Monitoring/src/V3/ListTimeSeriesRequest.php @@ -16,8 +16,11 @@ class ListTimeSeriesRequest extends \Google\Protobuf\Internal\Message { /** - * Required. The project on which to execute the request. The format is: + * 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) = { */ @@ -50,6 +53,13 @@ class ListTimeSeriesRequest extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.monitoring.v3.Aggregation aggregation = 5; */ private $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; + */ + private $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). @@ -89,8 +99,11 @@ class ListTimeSeriesRequest extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $name - * Required. The project on which to execute the request. The format is: + * 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 @@ -107,6 +120,9 @@ class ListTimeSeriesRequest extends \Google\Protobuf\Internal\Message * 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). @@ -130,8 +146,11 @@ public function __construct($data = NULL) { } /** - * Required. The project on which to execute the request. The format is: + * 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 @@ -142,8 +161,11 @@ public function getName() } /** - * Required. The project on which to execute the request. The format is: + * 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 @@ -199,13 +221,23 @@ public function setFilter($var) * in the response. * * Generated from protobuf field .google.monitoring.v3.TimeInterval interval = 4 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Monitoring\V3\TimeInterval + * @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 @@ -230,13 +262,23 @@ public function setInterval($var) * series data is returned. * * Generated from protobuf field .google.monitoring.v3.Aggregation aggregation = 5; - * @return \Google\Cloud\Monitoring\V3\Aggregation + * @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. @@ -255,6 +297,44 @@ public function setAggregation($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). @@ -303,7 +383,7 @@ public function getView() */ public function setView($var) { - GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\ListTimeSeriesRequest_TimeSeriesView::class); + GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\ListTimeSeriesRequest\TimeSeriesView::class); $this->view = $var; return $this; diff --git a/Monitoring/src/V3/ListTimeSeriesResponse.php b/Monitoring/src/V3/ListTimeSeriesResponse.php index 413a97831a9..3c95ae4b6eb 100644 --- a/Monitoring/src/V3/ListTimeSeriesResponse.php +++ b/Monitoring/src/V3/ListTimeSeriesResponse.php @@ -36,6 +36,17 @@ class ListTimeSeriesResponse extends \Google\Protobuf\Internal\Message * 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; + */ + private $unit = ''; /** * Constructor. @@ -52,6 +63,13 @@ class ListTimeSeriesResponse extends \Google\Protobuf\Internal\Message * @type \Google\Rpc\Status[]|\Google\Protobuf\Internal\RepeatedField $execution_errors * Query execution errors that may have caused the time series data returned * to be incomplete. + * @type string $unit + * The unit in which all `time_series` point values are reported. `unit` + * follows the UCUM format for units as seen in + * https://unitsofmeasure.org/ucum.html. + * If different `time_series` have different units (for example, because they + * come from different metric types, or a unit is absent), then `unit` will be + * "{not_a_unit}". * } */ public function __construct($data = NULL) { @@ -143,5 +161,41 @@ public function setExecutionErrors($var) 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/Monitoring/src/V3/ListUptimeCheckConfigsRequest.php b/Monitoring/src/V3/ListUptimeCheckConfigsRequest.php index 362cf253b5d..dc89eba494a 100644 --- a/Monitoring/src/V3/ListUptimeCheckConfigsRequest.php +++ b/Monitoring/src/V3/ListUptimeCheckConfigsRequest.php @@ -16,7 +16,8 @@ class ListUptimeCheckConfigsRequest extends \Google\Protobuf\Internal\Message { /** - * Required. The project whose Uptime check configurations are listed. The format is: + * 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) = { @@ -47,7 +48,8 @@ class ListUptimeCheckConfigsRequest extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $parent - * Required. The project whose Uptime check configurations are listed. The format is: + * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) + * whose Uptime check configurations are listed. The format is: * projects/[PROJECT_ID_OR_NUMBER] * @type int $page_size * The maximum number of results to return in a single response. The server @@ -66,7 +68,8 @@ public function __construct($data = NULL) { } /** - * Required. The project whose Uptime check configurations are listed. The format is: + * 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) = { @@ -78,7 +81,8 @@ public function getParent() } /** - * Required. The project whose Uptime check configurations are listed. The format is: + * 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) = { diff --git a/Monitoring/src/V3/MetricServiceClient.php b/Monitoring/src/V3/MetricServiceClient.php index e1c93fccab4..9b684d833d4 100644 --- a/Monitoring/src/V3/MetricServiceClient.php +++ b/Monitoring/src/V3/MetricServiceClient.php @@ -17,20 +17,18 @@ /* * GENERATED CODE WARNING - * This file was generated from the file - * https://github.com/google/googleapis/blob/master/google/monitoring/v3/metric_service.proto - * and updates to that file get reflected here through a refresh process. + * Generated by gapic-generator-php from the file + * https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/metric_service.proto + * Updates to the above are reflected here through a refresh process. */ namespace Google\Cloud\Monitoring\V3; use Google\Cloud\Monitoring\V3\Gapic\MetricServiceGapicClient; -/** - * {@inheritdoc} - */ +/** {@inheritdoc} */ class MetricServiceClient extends MetricServiceGapicClient { - // This class is intentionally empty, and is intended to hold manual - // additions to the generated {@see MetricServiceGapicClient} class. + // This class is intentionally empty, and is intended to hold manual additions to + // the generated {@see MetricServiceGapicClient} class. } diff --git a/Monitoring/src/V3/MetricServiceGrpcClient.php b/Monitoring/src/V3/MetricServiceGrpcClient.php index 192297fc62d..c8800806006 100644 --- a/Monitoring/src/V3/MetricServiceGrpcClient.php +++ b/Monitoring/src/V3/MetricServiceGrpcClient.php @@ -38,6 +38,7 @@ public function __construct($hostname, $opts, $channel = null) { * @param \Google\Cloud\Monitoring\V3\ListMonitoredResourceDescriptorsRequest $argument input argument * @param array $metadata metadata * @param array $options call options + * @return \Grpc\UnaryCall */ public function ListMonitoredResourceDescriptors(\Google\Cloud\Monitoring\V3\ListMonitoredResourceDescriptorsRequest $argument, $metadata = [], $options = []) { @@ -52,6 +53,7 @@ public function ListMonitoredResourceDescriptors(\Google\Cloud\Monitoring\V3\Lis * @param \Google\Cloud\Monitoring\V3\GetMonitoredResourceDescriptorRequest $argument input argument * @param array $metadata metadata * @param array $options call options + * @return \Grpc\UnaryCall */ public function GetMonitoredResourceDescriptor(\Google\Cloud\Monitoring\V3\GetMonitoredResourceDescriptorRequest $argument, $metadata = [], $options = []) { @@ -66,6 +68,7 @@ public function GetMonitoredResourceDescriptor(\Google\Cloud\Monitoring\V3\GetMo * @param \Google\Cloud\Monitoring\V3\ListMetricDescriptorsRequest $argument input argument * @param array $metadata metadata * @param array $options call options + * @return \Grpc\UnaryCall */ public function ListMetricDescriptors(\Google\Cloud\Monitoring\V3\ListMetricDescriptorsRequest $argument, $metadata = [], $options = []) { @@ -80,6 +83,7 @@ public function ListMetricDescriptors(\Google\Cloud\Monitoring\V3\ListMetricDesc * @param \Google\Cloud\Monitoring\V3\GetMetricDescriptorRequest $argument input argument * @param array $metadata metadata * @param array $options call options + * @return \Grpc\UnaryCall */ public function GetMetricDescriptor(\Google\Cloud\Monitoring\V3\GetMetricDescriptorRequest $argument, $metadata = [], $options = []) { @@ -91,11 +95,14 @@ public function GetMetricDescriptor(\Google\Cloud\Monitoring\V3\GetMetricDescrip /** * Creates a new metric descriptor. + * The creation is executed asynchronously and callers may check the returned + * operation to track its progress. * User-created metric descriptors define * [custom metrics](https://cloud.google.com/monitoring/custom-metrics). * @param \Google\Cloud\Monitoring\V3\CreateMetricDescriptorRequest $argument input argument * @param array $metadata metadata * @param array $options call options + * @return \Grpc\UnaryCall */ public function CreateMetricDescriptor(\Google\Cloud\Monitoring\V3\CreateMetricDescriptorRequest $argument, $metadata = [], $options = []) { @@ -112,6 +119,7 @@ public function CreateMetricDescriptor(\Google\Cloud\Monitoring\V3\CreateMetricD * @param \Google\Cloud\Monitoring\V3\DeleteMetricDescriptorRequest $argument input argument * @param array $metadata metadata * @param array $options call options + * @return \Grpc\UnaryCall */ public function DeleteMetricDescriptor(\Google\Cloud\Monitoring\V3\DeleteMetricDescriptorRequest $argument, $metadata = [], $options = []) { @@ -126,6 +134,7 @@ public function DeleteMetricDescriptor(\Google\Cloud\Monitoring\V3\DeleteMetricD * @param \Google\Cloud\Monitoring\V3\ListTimeSeriesRequest $argument input argument * @param array $metadata metadata * @param array $options call options + * @return \Grpc\UnaryCall */ public function ListTimeSeries(\Google\Cloud\Monitoring\V3\ListTimeSeriesRequest $argument, $metadata = [], $options = []) { @@ -143,6 +152,7 @@ public function ListTimeSeries(\Google\Cloud\Monitoring\V3\ListTimeSeriesRequest * @param \Google\Cloud\Monitoring\V3\CreateTimeSeriesRequest $argument input argument * @param array $metadata metadata * @param array $options call options + * @return \Grpc\UnaryCall */ public function CreateTimeSeries(\Google\Cloud\Monitoring\V3\CreateTimeSeriesRequest $argument, $metadata = [], $options = []) { @@ -152,4 +162,27 @@ public function CreateTimeSeries(\Google\Cloud\Monitoring\V3\CreateTimeSeriesReq $metadata, $options); } + /** + * Creates or adds data to one or more service time series. A service time + * series is a time series for a metric from a Google Cloud service. The + * response is empty if all time series in the request were written. If any + * time series could not be written, a corresponding failure message is + * included in the error response. This endpoint rejects writes to + * user-defined metrics. + * This method is only for use by Google Cloud services. Use + * [projects.timeSeries.create][google.monitoring.v3.MetricService.CreateTimeSeries] + * instead. + * @param \Google\Cloud\Monitoring\V3\CreateTimeSeriesRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function CreateServiceTimeSeries(\Google\Cloud\Monitoring\V3\CreateTimeSeriesRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.monitoring.v3.MetricService/CreateServiceTimeSeries', + $argument, + ['\Google\Protobuf\GPBEmpty', 'decode'], + $metadata, $options); + } + } diff --git a/Monitoring/src/V3/MutationRecord.php b/Monitoring/src/V3/MutationRecord.php index 6aef66c995a..9b2c8b6a9fa 100644 --- a/Monitoring/src/V3/MutationRecord.php +++ b/Monitoring/src/V3/MutationRecord.php @@ -49,13 +49,23 @@ public function __construct($data = NULL) { * When the change occurred. * * Generated from protobuf field .google.protobuf.Timestamp mutate_time = 1; - * @return \Google\Protobuf\Timestamp + * @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. * diff --git a/Monitoring/src/V3/NotificationChannel.php b/Monitoring/src/V3/NotificationChannel.php index 0b8a0bb1712..b97f550ea86 100644 --- a/Monitoring/src/V3/NotificationChannel.php +++ b/Monitoring/src/V3/NotificationChannel.php @@ -105,6 +105,18 @@ class NotificationChannel extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.protobuf.BoolValue enabled = 11; */ private $enabled = null; + /** + * Record of the creation of this channel. + * + * Generated from protobuf field .google.monitoring.v3.MutationRecord creation_record = 12; + */ + private $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. @@ -166,6 +178,10 @@ class NotificationChannel extends \Google\Protobuf\Internal\Message * the channel. This is a more convenient approach when the change is * temporary and you want to receive notifications from the same set * of alerting policies on the channel at some point in the future. + * @type \Google\Cloud\Monitoring\V3\MutationRecord $creation_record + * Record of the creation of this channel. + * @type \Google\Cloud\Monitoring\V3\MutationRecord[]|\Google\Protobuf\Internal\RepeatedField $mutation_records + * Records of the modification of this channel. * } */ public function __construct($data = NULL) { @@ -415,7 +431,7 @@ public function getVerificationStatus() */ public function setVerificationStatus($var) { - GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\NotificationChannel_VerificationStatus::class); + GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\NotificationChannel\VerificationStatus::class); $this->verification_status = $var; return $this; @@ -430,13 +446,23 @@ public function setVerificationStatus($var) * 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 + * @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() @@ -494,5 +520,67 @@ public function setEnabledValue($var) $this->writeWrapperValue("enabled", $var); return $this;} + /** + * Record of the creation of this channel. + * + * Generated from protobuf field .google.monitoring.v3.MutationRecord creation_record = 12; + * @return \Google\Cloud\Monitoring\V3\MutationRecord|null + */ + public function getCreationRecord() + { + return $this->creation_record; + } + + public function hasCreationRecord() + { + return isset($this->creation_record); + } + + public function clearCreationRecord() + { + unset($this->creation_record); + } + + /** + * Record of the creation of this channel. + * + * Generated from protobuf field .google.monitoring.v3.MutationRecord creation_record = 12; + * @param \Google\Cloud\Monitoring\V3\MutationRecord $var + * @return $this + */ + public function setCreationRecord($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\MutationRecord::class); + $this->creation_record = $var; + + return $this; + } + + /** + * Records of the modification of this channel. + * + * Generated from protobuf field repeated .google.monitoring.v3.MutationRecord mutation_records = 13; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMutationRecords() + { + return $this->mutation_records; + } + + /** + * Records of the modification of this channel. + * + * Generated from protobuf field repeated .google.monitoring.v3.MutationRecord mutation_records = 13; + * @param \Google\Cloud\Monitoring\V3\MutationRecord[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMutationRecords($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\MutationRecord::class); + $this->mutation_records = $arr; + + return $this; + } + } diff --git a/Monitoring/src/V3/NotificationChannelDescriptor.php b/Monitoring/src/V3/NotificationChannelDescriptor.php index bb9457d58d4..ffb3ef61807 100644 --- a/Monitoring/src/V3/NotificationChannelDescriptor.php +++ b/Monitoring/src/V3/NotificationChannelDescriptor.php @@ -26,7 +26,10 @@ class NotificationChannelDescriptor extends \Google\Protobuf\Internal\Message */ private $name = ''; /** - * The type of notification channel, such as "email", "sms", etc. + * 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; @@ -60,6 +63,7 @@ class NotificationChannelDescriptor extends \Google\Protobuf\Internal\Message * 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; /** @@ -80,7 +84,10 @@ class NotificationChannelDescriptor extends \Google\Protobuf\Internal\Message * 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", "sms", etc. + * 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 @@ -136,7 +143,10 @@ public function setName($var) } /** - * The type of notification channel, such as "email", "sms", etc. + * 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; @@ -148,7 +158,10 @@ public function getType() } /** - * The type of notification channel, such as "email", "sms", etc. + * 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; @@ -257,9 +270,11 @@ public function setLabels($var) * * 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; } @@ -270,9 +285,11 @@ public function getSupportedTiers() * Generated from protobuf field repeated .google.monitoring.v3.ServiceTier supported_tiers = 5 [deprecated = true]; * @param int[]|\Google\Protobuf\Internal\RepeatedField $var * @return $this + * @deprecated */ public function setSupportedTiers($var) { + @trigger_error('supported_tiers is deprecated.', E_USER_DEPRECATED); $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\Monitoring\V3\ServiceTier::class); $this->supported_tiers = $arr; diff --git a/Monitoring/src/V3/NotificationChannelServiceClient.php b/Monitoring/src/V3/NotificationChannelServiceClient.php index fafd92251ef..9d3f0043f2b 100644 --- a/Monitoring/src/V3/NotificationChannelServiceClient.php +++ b/Monitoring/src/V3/NotificationChannelServiceClient.php @@ -17,20 +17,18 @@ /* * GENERATED CODE WARNING - * This file was generated from the file - * https://github.com/google/googleapis/blob/master/google/monitoring/v3/notification_service.proto - * and updates to that file get reflected here through a refresh process. + * Generated by gapic-generator-php from the file + * https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/notification_service.proto + * Updates to the above are reflected here through a refresh process. */ namespace Google\Cloud\Monitoring\V3; use Google\Cloud\Monitoring\V3\Gapic\NotificationChannelServiceGapicClient; -/** - * {@inheritdoc} - */ +/** {@inheritdoc} */ class NotificationChannelServiceClient extends NotificationChannelServiceGapicClient { - // This class is intentionally empty, and is intended to hold manual - // additions to the generated {@see NotificationChannelServiceGapicClient} class. + // This class is intentionally empty, and is intended to hold manual additions to + // the generated {@see NotificationChannelServiceGapicClient} class. } diff --git a/Monitoring/src/V3/NotificationChannelServiceGrpcClient.php b/Monitoring/src/V3/NotificationChannelServiceGrpcClient.php index fc3234b67ae..71047be673f 100644 --- a/Monitoring/src/V3/NotificationChannelServiceGrpcClient.php +++ b/Monitoring/src/V3/NotificationChannelServiceGrpcClient.php @@ -39,6 +39,7 @@ public function __construct($hostname, $opts, $channel = null) { * @param \Google\Cloud\Monitoring\V3\ListNotificationChannelDescriptorsRequest $argument input argument * @param array $metadata metadata * @param array $options call options + * @return \Grpc\UnaryCall */ public function ListNotificationChannelDescriptors(\Google\Cloud\Monitoring\V3\ListNotificationChannelDescriptorsRequest $argument, $metadata = [], $options = []) { @@ -54,6 +55,7 @@ public function ListNotificationChannelDescriptors(\Google\Cloud\Monitoring\V3\L * @param \Google\Cloud\Monitoring\V3\GetNotificationChannelDescriptorRequest $argument input argument * @param array $metadata metadata * @param array $options call options + * @return \Grpc\UnaryCall */ public function GetNotificationChannelDescriptor(\Google\Cloud\Monitoring\V3\GetNotificationChannelDescriptorRequest $argument, $metadata = [], $options = []) { @@ -68,6 +70,7 @@ public function GetNotificationChannelDescriptor(\Google\Cloud\Monitoring\V3\Get * @param \Google\Cloud\Monitoring\V3\ListNotificationChannelsRequest $argument input argument * @param array $metadata metadata * @param array $options call options + * @return \Grpc\UnaryCall */ public function ListNotificationChannels(\Google\Cloud\Monitoring\V3\ListNotificationChannelsRequest $argument, $metadata = [], $options = []) { @@ -86,6 +89,7 @@ public function ListNotificationChannels(\Google\Cloud\Monitoring\V3\ListNotific * @param \Google\Cloud\Monitoring\V3\GetNotificationChannelRequest $argument input argument * @param array $metadata metadata * @param array $options call options + * @return \Grpc\UnaryCall */ public function GetNotificationChannel(\Google\Cloud\Monitoring\V3\GetNotificationChannelRequest $argument, $metadata = [], $options = []) { @@ -101,6 +105,7 @@ public function GetNotificationChannel(\Google\Cloud\Monitoring\V3\GetNotificati * @param \Google\Cloud\Monitoring\V3\CreateNotificationChannelRequest $argument input argument * @param array $metadata metadata * @param array $options call options + * @return \Grpc\UnaryCall */ public function CreateNotificationChannel(\Google\Cloud\Monitoring\V3\CreateNotificationChannelRequest $argument, $metadata = [], $options = []) { @@ -116,6 +121,7 @@ public function CreateNotificationChannel(\Google\Cloud\Monitoring\V3\CreateNoti * @param \Google\Cloud\Monitoring\V3\UpdateNotificationChannelRequest $argument input argument * @param array $metadata metadata * @param array $options call options + * @return \Grpc\UnaryCall */ public function UpdateNotificationChannel(\Google\Cloud\Monitoring\V3\UpdateNotificationChannelRequest $argument, $metadata = [], $options = []) { @@ -130,6 +136,7 @@ public function UpdateNotificationChannel(\Google\Cloud\Monitoring\V3\UpdateNoti * @param \Google\Cloud\Monitoring\V3\DeleteNotificationChannelRequest $argument input argument * @param array $metadata metadata * @param array $options call options + * @return \Grpc\UnaryCall */ public function DeleteNotificationChannel(\Google\Cloud\Monitoring\V3\DeleteNotificationChannelRequest $argument, $metadata = [], $options = []) { @@ -145,6 +152,7 @@ public function DeleteNotificationChannel(\Google\Cloud\Monitoring\V3\DeleteNoti * @param \Google\Cloud\Monitoring\V3\SendNotificationChannelVerificationCodeRequest $argument input argument * @param array $metadata metadata * @param array $options call options + * @return \Grpc\UnaryCall */ public function SendNotificationChannelVerificationCode(\Google\Cloud\Monitoring\V3\SendNotificationChannelVerificationCodeRequest $argument, $metadata = [], $options = []) { @@ -179,6 +187,7 @@ public function SendNotificationChannelVerificationCode(\Google\Cloud\Monitoring * @param \Google\Cloud\Monitoring\V3\GetNotificationChannelVerificationCodeRequest $argument input argument * @param array $metadata metadata * @param array $options call options + * @return \Grpc\UnaryCall */ public function GetNotificationChannelVerificationCode(\Google\Cloud\Monitoring\V3\GetNotificationChannelVerificationCodeRequest $argument, $metadata = [], $options = []) { @@ -195,6 +204,7 @@ public function GetNotificationChannelVerificationCode(\Google\Cloud\Monitoring\ * @param \Google\Cloud\Monitoring\V3\VerifyNotificationChannelRequest $argument input argument * @param array $metadata metadata * @param array $options call options + * @return \Grpc\UnaryCall */ public function VerifyNotificationChannel(\Google\Cloud\Monitoring\V3\VerifyNotificationChannelRequest $argument, $metadata = [], $options = []) { diff --git a/Monitoring/src/V3/Point.php b/Monitoring/src/V3/Point.php index c80c9763978..394d71566e8 100644 --- a/Monitoring/src/V3/Point.php +++ b/Monitoring/src/V3/Point.php @@ -73,13 +73,23 @@ public function __construct($data = NULL) { * time for the following points. * * Generated from protobuf field .google.monitoring.v3.TimeInterval interval = 1; - * @return \Google\Cloud\Monitoring\V3\TimeInterval + * @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 @@ -107,13 +117,23 @@ public function setInterval($var) * The value of the data point. * * Generated from protobuf field .google.monitoring.v3.TypedValue value = 2; - * @return \Google\Cloud\Monitoring\V3\TypedValue + * @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. * diff --git a/Monitoring/src/V3/QueryError.php b/Monitoring/src/V3/QueryError.php index 194bab830d3..e7f8b174c73 100644 --- a/Monitoring/src/V3/QueryError.php +++ b/Monitoring/src/V3/QueryError.php @@ -52,13 +52,23 @@ public function __construct($data = NULL) { * to. * * Generated from protobuf field .google.monitoring.v3.TextLocator locator = 1; - * @return \Google\Cloud\Monitoring\V3\TextLocator + * @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. diff --git a/owl-bot-staging/Monitoring/v3/src/V3/QueryServiceClient.php b/Monitoring/src/V3/QueryServiceClient.php similarity index 100% rename from owl-bot-staging/Monitoring/v3/src/V3/QueryServiceClient.php rename to Monitoring/src/V3/QueryServiceClient.php diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/QueryServiceGrpcClient.php b/Monitoring/src/V3/QueryServiceGrpcClient.php similarity index 100% rename from owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/QueryServiceGrpcClient.php rename to Monitoring/src/V3/QueryServiceGrpcClient.php diff --git a/Monitoring/src/V3/QueryTimeSeriesRequest.php b/Monitoring/src/V3/QueryTimeSeriesRequest.php index c4655be4704..9e1e3bcf747 100644 --- a/Monitoring/src/V3/QueryTimeSeriesRequest.php +++ b/Monitoring/src/V3/QueryTimeSeriesRequest.php @@ -16,17 +16,19 @@ class QueryTimeSeriesRequest extends \Google\Protobuf\Internal\Message { /** - * Required. The project 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; + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; */ private $name = ''; /** - * Required. The query in the monitoring query language format. The default - * time zone is in UTC. + * 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; + * Generated from protobuf field string query = 7 [(.google.api.field_behavior) = REQUIRED]; */ private $query = ''; /** @@ -51,11 +53,13 @@ class QueryTimeSeriesRequest extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $name - * Required. The project 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 language format. The default - * time zone is in UTC. + * 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 @@ -70,10 +74,11 @@ public function __construct($data = NULL) { } /** - * Required. The project 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; + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; * @return string */ public function getName() @@ -82,10 +87,11 @@ public function getName() } /** - * Required. The project 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; + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; * @param string $var * @return $this */ @@ -98,10 +104,11 @@ public function setName($var) } /** - * Required. The query in the monitoring query language format. The default - * time zone is in UTC. + * 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; + * Generated from protobuf field string query = 7 [(.google.api.field_behavior) = REQUIRED]; * @return string */ public function getQuery() @@ -110,10 +117,11 @@ public function getQuery() } /** - * Required. The query in the monitoring query language format. The default - * time zone is in UTC. + * 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; + * Generated from protobuf field string query = 7 [(.google.api.field_behavior) = REQUIRED]; * @param string $var * @return $this */ diff --git a/Monitoring/src/V3/QueryTimeSeriesResponse.php b/Monitoring/src/V3/QueryTimeSeriesResponse.php index 67377082c11..6bf5f6b56a7 100644 --- a/Monitoring/src/V3/QueryTimeSeriesResponse.php +++ b/Monitoring/src/V3/QueryTimeSeriesResponse.php @@ -73,13 +73,23 @@ public function __construct($data = NULL) { * 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 + * @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. * diff --git a/Monitoring/src/V3/Range.php b/Monitoring/src/V3/Range.php index 4c67ef56aa4..685c9574f8a 100644 --- a/Monitoring/src/V3/Range.php +++ b/Monitoring/src/V3/Range.php @@ -9,9 +9,7 @@ use Google\Protobuf\Internal\GPBUtil; /** - * Range of numerical values, inclusive of `min` and exclusive of `max`. If the - * open range "< range.max" is desired, set `range.min = -infinity`. If the open - * range ">= range.min" is desired, set `range.max = infinity`. + * Range of numerical values within `min` and `max`. * * Generated from protobuf message google.monitoring.v3.Range */ diff --git a/Monitoring/src/V3/RequestBasedSli.php b/Monitoring/src/V3/RequestBasedSli.php index 43b9d6f3e05..e4820f273c2 100644 --- a/Monitoring/src/V3/RequestBasedSli.php +++ b/Monitoring/src/V3/RequestBasedSli.php @@ -44,13 +44,18 @@ public function __construct($data = NULL) { * `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 + * @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`. @@ -74,13 +79,18 @@ public function setGoodTotalRatio($var) * `Distribution`. * * Generated from protobuf field .google.monitoring.v3.DistributionCut distribution_cut = 3; - * @return \Google\Cloud\Monitoring\V3\DistributionCut + * @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 diff --git a/Monitoring/src/V3/Service.php b/Monitoring/src/V3/Service.php index 042b3764cd7..af568f611c2 100644 --- a/Monitoring/src/V3/Service.php +++ b/Monitoring/src/V3/Service.php @@ -38,6 +38,17 @@ class Service extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.monitoring.v3.Service.Telemetry telemetry = 13; */ private $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; /** @@ -61,8 +72,19 @@ class Service extends \Google\Protobuf\Internal\Message * 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) { @@ -128,13 +150,18 @@ public function setDisplayName($var) * Custom service type. * * Generated from protobuf field .google.monitoring.v3.Service.Custom custom = 6; - * @return \Google\Cloud\Monitoring\V3\Service\Custom + * @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. * @@ -144,7 +171,7 @@ public function getCustom() */ public function setCustom($var) { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\Service_Custom::class); + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\Service\Custom::class); $this->writeOneof(6, $var); return $this; @@ -154,13 +181,18 @@ public function setCustom($var) * 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 + * @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. * @@ -170,7 +202,7 @@ public function getAppEngine() */ public function setAppEngine($var) { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\Service_AppEngine::class); + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\Service\AppEngine::class); $this->writeOneof(7, $var); return $this; @@ -180,13 +212,18 @@ public function setAppEngine($var) * 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 + * @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. * @@ -196,7 +233,7 @@ public function getCloudEndpoints() */ public function setCloudEndpoints($var) { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\Service_CloudEndpoints::class); + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\Service\CloudEndpoints::class); $this->writeOneof(8, $var); return $this; @@ -205,24 +242,29 @@ public function setCloudEndpoints($var) /** * Type used for Istio services that live in a Kubernetes cluster. * - * Generated from protobuf field .google.monitoring.v3.Service.ClusterIstio cluster_istio = 9 [deprecated = true]; - * @return \Google\Cloud\Monitoring\V3\Service\ClusterIstio + * 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 [deprecated = true]; + * 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); + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\Service\ClusterIstio::class); $this->writeOneof(9, $var); return $this; @@ -232,13 +274,18 @@ public function setClusterIstio($var) * 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 + * @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. * @@ -248,23 +295,68 @@ public function getMeshIstio() */ public function setMeshIstio($var) { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\Service_MeshIstio::class); + 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 + * @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. * @@ -274,12 +366,48 @@ public function getTelemetry() */ public function setTelemetry($var) { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\Service_Telemetry::class); + 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 */ diff --git a/Monitoring/src/V3/Service/ClusterIstio.php b/Monitoring/src/V3/Service/ClusterIstio.php index 93601fdd426..46beffd3f24 100644 --- a/Monitoring/src/V3/Service/ClusterIstio.php +++ b/Monitoring/src/V3/Service/ClusterIstio.php @@ -10,7 +10,8 @@ /** * Istio service scoped to a single Kubernetes cluster. Learn more at - * http://istio.io. + * https://istio.io. Clusters running OSS Istio will have their services + * ingested as this type. * * Generated from protobuf message google.monitoring.v3.Service.ClusterIstio */ diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service/IstioCanonicalService.php b/Monitoring/src/V3/Service/IstioCanonicalService.php similarity index 98% rename from owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service/IstioCanonicalService.php rename to Monitoring/src/V3/Service/IstioCanonicalService.php index 0feb3f3aaa8..e226bfee397 100644 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service/IstioCanonicalService.php +++ b/Monitoring/src/V3/Service/IstioCanonicalService.php @@ -23,7 +23,7 @@ class IstioCanonicalService extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string mesh_uid = 1; */ - protected $mesh_uid = ''; + private $mesh_uid = ''; /** * The namespace of the canonical service underlying this service. * Corresponds to the `destination_canonical_service_namespace` metric @@ -32,7 +32,7 @@ class IstioCanonicalService extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string canonical_service_namespace = 3; */ - protected $canonical_service_namespace = ''; + private $canonical_service_namespace = ''; /** * The name of the canonical service underlying this service. * Corresponds to the `destination_canonical_service_name` metric label in @@ -41,7 +41,7 @@ class IstioCanonicalService extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string canonical_service = 4; */ - protected $canonical_service = ''; + private $canonical_service = ''; /** * Constructor. diff --git a/Monitoring/src/V3/Service/MeshIstio.php b/Monitoring/src/V3/Service/MeshIstio.php index d8999d5cc8c..065c874bb0c 100644 --- a/Monitoring/src/V3/Service/MeshIstio.php +++ b/Monitoring/src/V3/Service/MeshIstio.php @@ -9,7 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** - * Istio service scoped to an Istio mesh + * Istio service scoped to an Istio mesh. Anthos clusters running ASM < 1.6.8 + * will have their services ingested as this type. * * Generated from protobuf message google.monitoring.v3.Service.MeshIstio */ diff --git a/Monitoring/src/V3/ServiceLevelIndicator.php b/Monitoring/src/V3/ServiceLevelIndicator.php index cbae960c0f2..a1d08a4e348 100644 --- a/Monitoring/src/V3/ServiceLevelIndicator.php +++ b/Monitoring/src/V3/ServiceLevelIndicator.php @@ -52,13 +52,18 @@ public function __construct($data = NULL) { * 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 + * @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. * @@ -78,13 +83,18 @@ public function setBasicSli($var) * Request-based SLIs * * Generated from protobuf field .google.monitoring.v3.RequestBasedSli request_based = 1; - * @return \Google\Cloud\Monitoring\V3\RequestBasedSli + * @return \Google\Cloud\Monitoring\V3\RequestBasedSli|null */ public function getRequestBased() { return $this->readOneof(1); } + public function hasRequestBased() + { + return $this->hasOneof(1); + } + /** * Request-based SLIs * @@ -104,13 +114,18 @@ public function setRequestBased($var) * Windows-based SLIs * * Generated from protobuf field .google.monitoring.v3.WindowsBasedSli windows_based = 2; - * @return \Google\Cloud\Monitoring\V3\WindowsBasedSli + * @return \Google\Cloud\Monitoring\V3\WindowsBasedSli|null */ public function getWindowsBased() { return $this->readOneof(2); } + public function hasWindowsBased() + { + return $this->hasOneof(2); + } + /** * Windows-based SLIs * diff --git a/Monitoring/src/V3/ServiceLevelObjective.php b/Monitoring/src/V3/ServiceLevelObjective.php index bff193c196f..38ca81f6b3a 100644 --- a/Monitoring/src/V3/ServiceLevelObjective.php +++ b/Monitoring/src/V3/ServiceLevelObjective.php @@ -48,6 +48,17 @@ class ServiceLevelObjective extends \Google\Protobuf\Internal\Message * Generated from protobuf field double goal = 4; */ private $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; /** @@ -75,6 +86,13 @@ class ServiceLevelObjective extends \Google\Protobuf\Internal\Message * 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) { @@ -142,13 +160,23 @@ public function setDisplayName($var) * quality. * * Generated from protobuf field .google.monitoring.v3.ServiceLevelIndicator service_level_indicator = 3; - * @return \Google\Cloud\Monitoring\V3\ServiceLevelIndicator + * @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 @@ -199,13 +227,18 @@ public function setGoal($var) * 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 + * @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. @@ -235,6 +268,11 @@ 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 @@ -252,6 +290,42 @@ public function setCalendarPeriod($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 */ diff --git a/Monitoring/src/V3/ServiceMonitoringServiceClient.php b/Monitoring/src/V3/ServiceMonitoringServiceClient.php index 9c32d71f8bd..d4e7b2cbfc2 100644 --- a/Monitoring/src/V3/ServiceMonitoringServiceClient.php +++ b/Monitoring/src/V3/ServiceMonitoringServiceClient.php @@ -17,20 +17,18 @@ /* * GENERATED CODE WARNING - * This file was generated from the file - * https://github.com/google/googleapis/blob/master/google/monitoring/v3/service_service.proto - * and updates to that file get reflected here through a refresh process. + * Generated by gapic-generator-php from the file + * https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service_service.proto + * Updates to the above are reflected here through a refresh process. */ namespace Google\Cloud\Monitoring\V3; use Google\Cloud\Monitoring\V3\Gapic\ServiceMonitoringServiceGapicClient; -/** - * {@inheritdoc} - */ +/** {@inheritdoc} */ class ServiceMonitoringServiceClient extends ServiceMonitoringServiceGapicClient { - // This class is intentionally empty, and is intended to hold manual - // additions to the generated {@see ServiceMonitoringServiceGapicClient} class. + // This class is intentionally empty, and is intended to hold manual additions to + // the generated {@see ServiceMonitoringServiceGapicClient} class. } diff --git a/Monitoring/src/V3/ServiceMonitoringServiceGrpcClient.php b/Monitoring/src/V3/ServiceMonitoringServiceGrpcClient.php index 282e06f346a..6d3aeb58dd5 100644 --- a/Monitoring/src/V3/ServiceMonitoringServiceGrpcClient.php +++ b/Monitoring/src/V3/ServiceMonitoringServiceGrpcClient.php @@ -40,6 +40,7 @@ public function __construct($hostname, $opts, $channel = null) { * @param \Google\Cloud\Monitoring\V3\CreateServiceRequest $argument input argument * @param array $metadata metadata * @param array $options call options + * @return \Grpc\UnaryCall */ public function CreateService(\Google\Cloud\Monitoring\V3\CreateServiceRequest $argument, $metadata = [], $options = []) { @@ -54,6 +55,7 @@ public function CreateService(\Google\Cloud\Monitoring\V3\CreateServiceRequest $ * @param \Google\Cloud\Monitoring\V3\GetServiceRequest $argument input argument * @param array $metadata metadata * @param array $options call options + * @return \Grpc\UnaryCall */ public function GetService(\Google\Cloud\Monitoring\V3\GetServiceRequest $argument, $metadata = [], $options = []) { @@ -68,6 +70,7 @@ public function GetService(\Google\Cloud\Monitoring\V3\GetServiceRequest $argume * @param \Google\Cloud\Monitoring\V3\ListServicesRequest $argument input argument * @param array $metadata metadata * @param array $options call options + * @return \Grpc\UnaryCall */ public function ListServices(\Google\Cloud\Monitoring\V3\ListServicesRequest $argument, $metadata = [], $options = []) { @@ -82,6 +85,7 @@ public function ListServices(\Google\Cloud\Monitoring\V3\ListServicesRequest $ar * @param \Google\Cloud\Monitoring\V3\UpdateServiceRequest $argument input argument * @param array $metadata metadata * @param array $options call options + * @return \Grpc\UnaryCall */ public function UpdateService(\Google\Cloud\Monitoring\V3\UpdateServiceRequest $argument, $metadata = [], $options = []) { @@ -96,6 +100,7 @@ public function UpdateService(\Google\Cloud\Monitoring\V3\UpdateServiceRequest $ * @param \Google\Cloud\Monitoring\V3\DeleteServiceRequest $argument input argument * @param array $metadata metadata * @param array $options call options + * @return \Grpc\UnaryCall */ public function DeleteService(\Google\Cloud\Monitoring\V3\DeleteServiceRequest $argument, $metadata = [], $options = []) { @@ -110,6 +115,7 @@ public function DeleteService(\Google\Cloud\Monitoring\V3\DeleteServiceRequest $ * @param \Google\Cloud\Monitoring\V3\CreateServiceLevelObjectiveRequest $argument input argument * @param array $metadata metadata * @param array $options call options + * @return \Grpc\UnaryCall */ public function CreateServiceLevelObjective(\Google\Cloud\Monitoring\V3\CreateServiceLevelObjectiveRequest $argument, $metadata = [], $options = []) { @@ -124,6 +130,7 @@ public function CreateServiceLevelObjective(\Google\Cloud\Monitoring\V3\CreateSe * @param \Google\Cloud\Monitoring\V3\GetServiceLevelObjectiveRequest $argument input argument * @param array $metadata metadata * @param array $options call options + * @return \Grpc\UnaryCall */ public function GetServiceLevelObjective(\Google\Cloud\Monitoring\V3\GetServiceLevelObjectiveRequest $argument, $metadata = [], $options = []) { @@ -138,6 +145,7 @@ public function GetServiceLevelObjective(\Google\Cloud\Monitoring\V3\GetServiceL * @param \Google\Cloud\Monitoring\V3\ListServiceLevelObjectivesRequest $argument input argument * @param array $metadata metadata * @param array $options call options + * @return \Grpc\UnaryCall */ public function ListServiceLevelObjectives(\Google\Cloud\Monitoring\V3\ListServiceLevelObjectivesRequest $argument, $metadata = [], $options = []) { @@ -152,6 +160,7 @@ public function ListServiceLevelObjectives(\Google\Cloud\Monitoring\V3\ListServi * @param \Google\Cloud\Monitoring\V3\UpdateServiceLevelObjectiveRequest $argument input argument * @param array $metadata metadata * @param array $options call options + * @return \Grpc\UnaryCall */ public function UpdateServiceLevelObjective(\Google\Cloud\Monitoring\V3\UpdateServiceLevelObjectiveRequest $argument, $metadata = [], $options = []) { @@ -166,6 +175,7 @@ public function UpdateServiceLevelObjective(\Google\Cloud\Monitoring\V3\UpdateSe * @param \Google\Cloud\Monitoring\V3\DeleteServiceLevelObjectiveRequest $argument input argument * @param array $metadata metadata * @param array $options call options + * @return \Grpc\UnaryCall */ public function DeleteServiceLevelObjective(\Google\Cloud\Monitoring\V3\DeleteServiceLevelObjectiveRequest $argument, $metadata = [], $options = []) { diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service_IstioCanonicalService.php b/Monitoring/src/V3/Service_IstioCanonicalService.php similarity index 100% rename from owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service_IstioCanonicalService.php rename to Monitoring/src/V3/Service_IstioCanonicalService.php diff --git a/Monitoring/src/V3/SpanContext.php b/Monitoring/src/V3/SpanContext.php index 074b974b82f..437097e5001 100644 --- a/Monitoring/src/V3/SpanContext.php +++ b/Monitoring/src/V3/SpanContext.php @@ -9,8 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** - * The context of a span, attached to - * [Exemplars][google.api.Distribution.Exemplars] + * The context of a span. This is attached to an + * [Exemplar][google.api.Distribution.Exemplar] * in [Distribution][google.api.Distribution] values during aggregation. * It contains the name of a span with format: * projects/[PROJECT_ID_OR_NUMBER]/traces/[TRACE_ID]/spans/[SPAN_ID] diff --git a/Monitoring/src/V3/TextLocator.php b/Monitoring/src/V3/TextLocator.php index 9ca0ebb0080..0db0f3c6fe4 100644 --- a/Monitoring/src/V3/TextLocator.php +++ b/Monitoring/src/V3/TextLocator.php @@ -153,13 +153,23 @@ public function setSource($var) * 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 + * @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. * @@ -169,7 +179,7 @@ public function getStartPosition() */ public function setStartPosition($var) { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\TextLocator_Position::class); + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\TextLocator\Position::class); $this->start_position = $var; return $this; @@ -179,13 +189,23 @@ public function setStartPosition($var) * 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 + * @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. * @@ -195,7 +215,7 @@ public function getEndPosition() */ public function setEndPosition($var) { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\TextLocator_Position::class); + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\TextLocator\Position::class); $this->end_position = $var; return $this; @@ -208,13 +228,23 @@ public function setEndPosition($var) * identifies the location within that object. * * Generated from protobuf field .google.monitoring.v3.TextLocator nested_locator = 4; - * @return \Google\Cloud\Monitoring\V3\TextLocator + * @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 diff --git a/Monitoring/src/V3/TimeInterval.php b/Monitoring/src/V3/TimeInterval.php index 5e80ab990b5..532a64739b0 100644 --- a/Monitoring/src/V3/TimeInterval.php +++ b/Monitoring/src/V3/TimeInterval.php @@ -9,21 +9,30 @@ 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. In no case can the end time be earlier than the start time. - * * For a `GAUGE` metric, the `startTime` value is technically optional; if + * 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. - * * For `DELTA` and `CUMULATIVE` metrics, the start time must be earlier - * than the end time. - * * In all cases, the start time of the next interval must be - * at least a millisecond after the end time of the previous interval. - * Because the interval is closed, if the start time of a new interval - * is the same as the end time of the previous interval, data written - * at the new start time could overwrite data written at the previous - * end 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 */ @@ -67,13 +76,23 @@ public function __construct($data = NULL) { * Required. The end of the time interval. * * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; - * @return \Google\Protobuf\Timestamp + * @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. * @@ -95,13 +114,23 @@ public function setEndTime($var) * later than the end time. * * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; - * @return \Google\Protobuf\Timestamp + * @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 diff --git a/Monitoring/src/V3/TimeSeries.php b/Monitoring/src/V3/TimeSeries.php index 900fb385557..869bcb7ef92 100644 --- a/Monitoring/src/V3/TimeSeries.php +++ b/Monitoring/src/V3/TimeSeries.php @@ -27,15 +27,17 @@ class TimeSeries extends \Google\Protobuf\Internal\Message private $metric = null; /** * The associated monitored resource. Custom metrics can use only certain - * monitored resource types in their time series data. + * 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; */ private $resource = null; /** * Output only. The associated monitored resource metadata. When reading a - * a timeseries, this field will include metadata labels that are explicitly - * named in the reduction. When creating a timeseries, this field is ignored. + * 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; */ @@ -75,6 +77,14 @@ class TimeSeries extends \Google\Protobuf\Internal\Message * 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; + */ + private $unit = ''; /** * Constructor. @@ -87,11 +97,13 @@ class TimeSeries extends \Google\Protobuf\Internal\Message * series. * @type \Google\Api\MonitoredResource $resource * The associated monitored resource. Custom metrics can use only certain - * monitored resource types in their time series data. + * 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 - * a timeseries, this field will include metadata labels that are explicitly - * named in the reduction. When creating a timeseries, this field is ignored. + * 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 @@ -115,6 +127,10 @@ class TimeSeries extends \Google\Protobuf\Internal\Message * 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) { @@ -127,13 +143,23 @@ public function __construct($data = NULL) { * series. * * Generated from protobuf field .google.api.Metric metric = 1; - * @return \Google\Api\Metric + * @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. @@ -152,19 +178,33 @@ public function setMetric($var) /** * The associated monitored resource. Custom metrics can use only certain - * monitored resource types in their time series data. + * 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 + * @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. + * 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 @@ -180,21 +220,31 @@ public function setResource($var) /** * Output only. The associated monitored resource metadata. When reading a - * a timeseries, this field will include metadata labels that are explicitly - * named in the reduction. When creating a timeseries, this field is ignored. + * 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 + * @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 - * a timeseries, this field will include metadata labels that are explicitly - * named in the reduction. When creating a timeseries, this field is ignored. + * 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 @@ -242,7 +292,7 @@ public function getMetricKind() */ public function setMetricKind($var) { - GPBUtil::checkEnum($var, \Google\Api\MetricDescriptor_MetricKind::class); + GPBUtil::checkEnum($var, \Google\Api\MetricDescriptor\MetricKind::class); $this->metric_kind = $var; return $this; @@ -276,7 +326,7 @@ public function getValueType() */ public function setValueType($var) { - GPBUtil::checkEnum($var, \Google\Api\MetricDescriptor_ValueType::class); + GPBUtil::checkEnum($var, \Google\Api\MetricDescriptor\ValueType::class); $this->value_type = $var; return $this; @@ -320,5 +370,35 @@ public function setPoints($var) 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/Monitoring/src/V3/TimeSeriesData/PointData.php b/Monitoring/src/V3/TimeSeriesData/PointData.php index ff73eb6a9bd..a4406d93644 100644 --- a/Monitoring/src/V3/TimeSeriesData/PointData.php +++ b/Monitoring/src/V3/TimeSeriesData/PointData.php @@ -77,13 +77,23 @@ public function setValues($var) * The time interval associated with the point. * * Generated from protobuf field .google.monitoring.v3.TimeInterval time_interval = 2; - * @return \Google\Cloud\Monitoring\V3\TimeInterval + * @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. * diff --git a/Monitoring/src/V3/TimeSeriesDescriptor.php b/Monitoring/src/V3/TimeSeriesDescriptor.php index 916e87928eb..6bd08bc8355 100644 --- a/Monitoring/src/V3/TimeSeriesDescriptor.php +++ b/Monitoring/src/V3/TimeSeriesDescriptor.php @@ -9,7 +9,7 @@ use Google\Protobuf\Internal\GPBUtil; /** - * A descriptor for the labels and points in a timeseries. + * A descriptor for the labels and points in a time series. * * Generated from protobuf message google.monitoring.v3.TimeSeriesDescriptor */ diff --git a/Monitoring/src/V3/TimeSeriesDescriptor/ValueDescriptor.php b/Monitoring/src/V3/TimeSeriesDescriptor/ValueDescriptor.php index 5429f9062e0..a3eff313914 100644 --- a/Monitoring/src/V3/TimeSeriesDescriptor/ValueDescriptor.php +++ b/Monitoring/src/V3/TimeSeriesDescriptor/ValueDescriptor.php @@ -33,6 +33,15 @@ class ValueDescriptor extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.api.MetricDescriptor.MetricKind metric_kind = 3; */ private $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; + */ + private $unit = ''; /** * Constructor. @@ -46,6 +55,11 @@ class ValueDescriptor extends \Google\Protobuf\Internal\Message * 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) { @@ -99,7 +113,7 @@ public function getValueType() */ public function setValueType($var) { - GPBUtil::checkEnum($var, \Google\Api\MetricDescriptor_ValueType::class); + GPBUtil::checkEnum($var, \Google\Api\MetricDescriptor\ValueType::class); $this->value_type = $var; return $this; @@ -125,12 +139,44 @@ public function getMetricKind() */ public function setMetricKind($var) { - GPBUtil::checkEnum($var, \Google\Api\MetricDescriptor_MetricKind::class); + 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. diff --git a/Monitoring/src/V3/TypedValue.php b/Monitoring/src/V3/TypedValue.php index 17be9bcbf77..866bd8da016 100644 --- a/Monitoring/src/V3/TypedValue.php +++ b/Monitoring/src/V3/TypedValue.php @@ -53,6 +53,11 @@ public function getBoolValue() return $this->readOneof(1); } + public function hasBoolValue() + { + return $this->hasOneof(1); + } + /** * A Boolean value: `true` or `false`. * @@ -79,6 +84,11 @@ public function getInt64Value() return $this->readOneof(2); } + public function hasInt64Value() + { + return $this->hasOneof(2); + } + /** * A 64-bit integer. Its range is approximately ±9.2x1018. * @@ -107,6 +117,11 @@ 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 @@ -135,6 +150,11 @@ public function getStringValue() return $this->readOneof(4); } + public function hasStringValue() + { + return $this->hasOneof(4); + } + /** * A variable-length string value. * @@ -154,13 +174,18 @@ public function setStringValue($var) * A distribution value. * * Generated from protobuf field .google.api.Distribution distribution_value = 5; - * @return \Google\Api\Distribution + * @return \Google\Api\Distribution|null */ public function getDistributionValue() { return $this->readOneof(5); } + public function hasDistributionValue() + { + return $this->hasOneof(5); + } + /** * A distribution value. * diff --git a/Monitoring/src/V3/UpdateAlertPolicyRequest.php b/Monitoring/src/V3/UpdateAlertPolicyRequest.php index fa0dde31f88..f57aefb4402 100644 --- a/Monitoring/src/V3/UpdateAlertPolicyRequest.php +++ b/Monitoring/src/V3/UpdateAlertPolicyRequest.php @@ -106,13 +106,23 @@ public function __construct($data = NULL) { * then a new `[CONDITION_ID]` is created. * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @return \Google\Protobuf\FieldMask + * @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 @@ -152,13 +162,23 @@ public function setUpdateMask($var) * 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 + * @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`. diff --git a/Monitoring/src/V3/UpdateGroupRequest.php b/Monitoring/src/V3/UpdateGroupRequest.php index 538b82b3695..3ae1729c8f1 100644 --- a/Monitoring/src/V3/UpdateGroupRequest.php +++ b/Monitoring/src/V3/UpdateGroupRequest.php @@ -52,13 +52,23 @@ public function __construct($data = NULL) { * 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 + * @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. diff --git a/Monitoring/src/V3/UpdateNotificationChannelRequest.php b/Monitoring/src/V3/UpdateNotificationChannelRequest.php index 1a85f2ad172..2e2dc8fe082 100644 --- a/Monitoring/src/V3/UpdateNotificationChannelRequest.php +++ b/Monitoring/src/V3/UpdateNotificationChannelRequest.php @@ -55,13 +55,23 @@ public function __construct($data = NULL) { * The fields to update. * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @return \Google\Protobuf\FieldMask + * @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. * @@ -84,13 +94,23 @@ public function setUpdateMask($var) * 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 + * @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 diff --git a/Monitoring/src/V3/UpdateServiceLevelObjectiveRequest.php b/Monitoring/src/V3/UpdateServiceLevelObjectiveRequest.php index 3bf99609c2c..dd37432b2e2 100644 --- a/Monitoring/src/V3/UpdateServiceLevelObjectiveRequest.php +++ b/Monitoring/src/V3/UpdateServiceLevelObjectiveRequest.php @@ -52,13 +52,23 @@ public function __construct($data = NULL) { * 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 + * @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. @@ -79,13 +89,23 @@ public function setServiceLevelObjective($var) * 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 + * @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. * diff --git a/Monitoring/src/V3/UpdateServiceRequest.php b/Monitoring/src/V3/UpdateServiceRequest.php index c2df403a3fa..a577427e2fa 100644 --- a/Monitoring/src/V3/UpdateServiceRequest.php +++ b/Monitoring/src/V3/UpdateServiceRequest.php @@ -52,13 +52,23 @@ public function __construct($data = NULL) { * 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 + * @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. @@ -79,13 +89,23 @@ public function setService($var) * 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 + * @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. * diff --git a/Monitoring/src/V3/UpdateUptimeCheckConfigRequest.php b/Monitoring/src/V3/UpdateUptimeCheckConfigRequest.php index 3333b41bb00..7128d96eb50 100644 --- a/Monitoring/src/V3/UpdateUptimeCheckConfigRequest.php +++ b/Monitoring/src/V3/UpdateUptimeCheckConfigRequest.php @@ -76,13 +76,23 @@ public function __construct($data = NULL) { * the new configuration. * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @return \Google\Protobuf\FieldMask + * @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 @@ -114,13 +124,23 @@ public function setUpdateMask($var) * `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 + * @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 diff --git a/Monitoring/src/V3/UptimeCheckConfig.php b/Monitoring/src/V3/UptimeCheckConfig.php index f05685ab407..f797836ddab 100644 --- a/Monitoring/src/V3/UptimeCheckConfig.php +++ b/Monitoring/src/V3/UptimeCheckConfig.php @@ -19,6 +19,8 @@ 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. @@ -77,8 +79,9 @@ class UptimeCheckConfig extends \Google\Protobuf\Internal\Message * or to provide 'internal_checkers' when is_internal is `false`. * * Generated from protobuf field bool is_internal = 15 [deprecated = true]; + * @deprecated */ - private $is_internal = false; + 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 @@ -86,6 +89,7 @@ class UptimeCheckConfig extends \Google\Protobuf\Internal\Message * `UptimeCheckConfig`. * * Generated from protobuf field repeated .google.monitoring.v3.InternalChecker internal_checkers = 14 [deprecated = true]; + * @deprecated */ private $internal_checkers; protected $resource; @@ -100,6 +104,8 @@ class UptimeCheckConfig extends \Google\Protobuf\Internal\Message * @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. @@ -111,12 +117,13 @@ class UptimeCheckConfig extends \Google\Protobuf\Internal\Message * The [monitored * resource](https://cloud.google.com/monitoring/api/resources) associated * with the configuration. - * The following monitored resource types are supported for Uptime checks: + * The following monitored resource types are valid for this field: * `uptime_url`, * `gce_instance`, * `gae_app`, * `aws_ec2_instance`, * `aws_elb_load_balancer` + * `k8s_service` * @type \Google\Cloud\Monitoring\V3\UptimeCheckConfig\ResourceGroup $resource_group * The group resource associated with the configuration. * @type \Google\Cloud\Monitoring\V3\UptimeCheckConfig\HttpCheck $http_check @@ -163,6 +170,8 @@ public function __construct($data = NULL) { /** * 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. @@ -178,6 +187,8 @@ public function getName() /** * 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. @@ -228,31 +239,38 @@ public function setDisplayName($var) * The [monitored * resource](https://cloud.google.com/monitoring/api/resources) associated * with the configuration. - * The following monitored resource types are supported for Uptime checks: + * The following monitored resource types are valid for this field: * `uptime_url`, * `gce_instance`, * `gae_app`, * `aws_ec2_instance`, * `aws_elb_load_balancer` + * `k8s_service` * * Generated from protobuf field .google.api.MonitoredResource monitored_resource = 3; - * @return \Google\Api\MonitoredResource + * @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 supported for Uptime checks: + * The following monitored resource types are valid for this field: * `uptime_url`, * `gce_instance`, * `gae_app`, * `aws_ec2_instance`, * `aws_elb_load_balancer` + * `k8s_service` * * Generated from protobuf field .google.api.MonitoredResource monitored_resource = 3; * @param \Google\Api\MonitoredResource $var @@ -270,13 +288,18 @@ public function setMonitoredResource($var) * 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 + * @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. * @@ -286,7 +309,7 @@ public function getResourceGroup() */ public function setResourceGroup($var) { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\UptimeCheckConfig_ResourceGroup::class); + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\UptimeCheckConfig\ResourceGroup::class); $this->writeOneof(4, $var); return $this; @@ -296,13 +319,18 @@ public function setResourceGroup($var) * 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 + * @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. * @@ -312,7 +340,7 @@ public function getHttpCheck() */ public function setHttpCheck($var) { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\UptimeCheckConfig_HttpCheck::class); + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\UptimeCheckConfig\HttpCheck::class); $this->writeOneof(5, $var); return $this; @@ -322,13 +350,18 @@ public function setHttpCheck($var) * 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 + * @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. * @@ -338,7 +371,7 @@ public function getTcpCheck() */ public function setTcpCheck($var) { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\UptimeCheckConfig_TcpCheck::class); + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\UptimeCheckConfig\TcpCheck::class); $this->writeOneof(6, $var); return $this; @@ -351,13 +384,23 @@ public function setTcpCheck($var) * defaults to `60s`. * * Generated from protobuf field .google.protobuf.Duration period = 7; - * @return \Google\Protobuf\Duration + * @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` @@ -381,13 +424,23 @@ public function setPeriod($var) * between 1 and 60 seconds). Required. * * Generated from protobuf field .google.protobuf.Duration timeout = 8; - * @return \Google\Protobuf\Duration + * @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. @@ -480,9 +533,11 @@ public function setSelectedRegions($var) * * 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; } @@ -495,9 +550,11 @@ public function getIsInternal() * 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; @@ -512,9 +569,11 @@ public function setIsInternal($var) * * 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; } @@ -527,9 +586,11 @@ public function getInternalCheckers() * Generated from protobuf field repeated .google.monitoring.v3.InternalChecker internal_checkers = 14 [deprecated = true]; * @param \Google\Cloud\Monitoring\V3\InternalChecker[]|\Google\Protobuf\Internal\RepeatedField $var * @return $this + * @deprecated */ public function setInternalCheckers($var) { + @trigger_error('internal_checkers is deprecated.', E_USER_DEPRECATED); $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\InternalChecker::class); $this->internal_checkers = $arr; diff --git a/Monitoring/src/V3/UptimeCheckConfig/ContentMatcher.php b/Monitoring/src/V3/UptimeCheckConfig/ContentMatcher.php index ce3bfdb7c0f..70d67f1e0a9 100644 --- a/Monitoring/src/V3/UptimeCheckConfig/ContentMatcher.php +++ b/Monitoring/src/V3/UptimeCheckConfig/ContentMatcher.php @@ -103,7 +103,7 @@ public function getMatcher() */ public function setMatcher($var) { - GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\UptimeCheckConfig_ContentMatcher_ContentMatcherOption::class); + GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\UptimeCheckConfig\ContentMatcher\ContentMatcherOption::class); $this->matcher = $var; return $this; diff --git a/Monitoring/src/V3/UptimeCheckConfig/ContentMatcher/ContentMatcherOption.php b/Monitoring/src/V3/UptimeCheckConfig/ContentMatcher/ContentMatcherOption.php index 42873757d09..b2d900726d2 100644 --- a/Monitoring/src/V3/UptimeCheckConfig/ContentMatcher/ContentMatcherOption.php +++ b/Monitoring/src/V3/UptimeCheckConfig/ContentMatcher/ContentMatcherOption.php @@ -40,6 +40,7 @@ class ContentMatcherOption /** * Selects regular-expression matching. The match succeeds of the output * matches the regular expression specified in the `content` string. + * Regex matching is only supported for HTTP/HTTPS checks. * * Generated from protobuf enum MATCHES_REGEX = 3; */ @@ -47,7 +48,8 @@ class ContentMatcherOption /** * Selects negation of regular-expression matching. The match succeeds if * the output does _NOT_ match the regular expression specified in the - * `content` string. + * `content` string. Regex matching is only supported for HTTP/HTTPS + * checks. * * Generated from protobuf enum NOT_MATCHES_REGEX = 4; */ diff --git a/Monitoring/src/V3/UptimeCheckConfig/HttpCheck.php b/Monitoring/src/V3/UptimeCheckConfig/HttpCheck.php index 30387e19007..41a1e56fac2 100644 --- a/Monitoring/src/V3/UptimeCheckConfig/HttpCheck.php +++ b/Monitoring/src/V3/UptimeCheckConfig/HttpCheck.php @@ -15,6 +15,13 @@ */ 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; + */ + private $request_method = 0; /** * If `true`, use HTTPS instead of HTTP to run the check. * @@ -48,7 +55,7 @@ class HttpCheck extends \Google\Protobuf\Internal\Message */ private $auth_info = null; /** - * Boolean specifiying whether to encrypt the header information. + * 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. @@ -71,6 +78,19 @@ class HttpCheck extends \Google\Protobuf\Internal\Message * 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; + */ + private $content_type = 0; /** * Boolean specifying whether to include SSL certificate validation as a * part of the Uptime check. Only applies to checks where @@ -80,6 +100,19 @@ class HttpCheck extends \Google\Protobuf\Internal\Message * Generated from protobuf field bool validate_ssl = 7; */ private $validate_ssl = false; + /** + * The request body associated with the HTTP POST request. If `content_type` + * is `URL_ENCODED`, the body passed in must be URL-encoded. Users can + * provide a `Content-Length` header via the `headers` field or the API will + * do so. If the `request_method` is `GET` and `body` is not empty, the API + * will return an error. The maximum byte size is 1 megabyte. Note: As with + * all `bytes` fields, JSON representations are base64 encoded. e.g.: + * "foo=bar" in URL-encoded form is "foo%3Dbar" and in base64 encoding is + * "Zm9vJTI1M0RiYXI=". + * + * Generated from protobuf field bytes body = 10; + */ + private $body = ''; /** * Constructor. @@ -87,6 +120,9 @@ class HttpCheck extends \Google\Protobuf\Internal\Message * @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 @@ -104,7 +140,7 @@ class HttpCheck extends \Google\Protobuf\Internal\Message * The authentication information. Optional when creating an HTTP check; * defaults to empty. * @type bool $mask_headers - * Boolean specifiying whether to encrypt the header information. + * 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. @@ -119,11 +155,29 @@ class HttpCheck extends \Google\Protobuf\Internal\Message * Entering two separate headers with the same key in a Create call will * cause the first to be overwritten by the second. * The maximum number of headers allowed is 100. + * @type int $content_type + * The content type header to use for the check. The following + * configurations result in errors: + * 1. Content type is specified in both the `headers` field and the + * `content_type` field. + * 2. Request method is `GET` and `content_type` is not `TYPE_UNSPECIFIED` + * 3. Request method is `POST` and `content_type` is `TYPE_UNSPECIFIED`. + * 4. Request method is `POST` and a "Content-Type" header is provided via + * `headers` field. The `content_type` field should be used instead. * @type bool $validate_ssl * Boolean specifying whether to include SSL certificate validation as a * part of the Uptime check. Only applies to checks where * `monitored_resource` is set to `uptime_url`. If `use_ssl` is `false`, * setting `validate_ssl` to `true` has no effect. + * @type string $body + * The request body associated with the HTTP POST request. If `content_type` + * is `URL_ENCODED`, the body passed in must be URL-encoded. Users can + * provide a `Content-Length` header via the `headers` field or the API will + * do so. If the `request_method` is `GET` and `body` is not empty, the API + * will return an error. The maximum byte size is 1 megabyte. Note: As with + * all `bytes` fields, JSON representations are base64 encoded. e.g.: + * "foo=bar" in URL-encoded form is "foo%3Dbar" and in base64 encoding is + * "Zm9vJTI1M0RiYXI=". * } */ public function __construct($data = NULL) { @@ -131,6 +185,34 @@ public function __construct($data = NULL) { 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. * @@ -228,13 +310,23 @@ public function setPort($var) * defaults to empty. * * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.HttpCheck.BasicAuthentication auth_info = 4; - * @return \Google\Cloud\Monitoring\V3\UptimeCheckConfig\HttpCheck\BasicAuthentication + * @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. @@ -245,14 +337,14 @@ public function getAuthInfo() */ public function setAuthInfo($var) { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\UptimeCheckConfig_HttpCheck_BasicAuthentication::class); + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\UptimeCheckConfig\HttpCheck\BasicAuthentication::class); $this->auth_info = $var; return $this; } /** - * Boolean specifiying whether to encrypt the header information. + * 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. @@ -268,7 +360,7 @@ public function getMaskHeaders() } /** - * Boolean specifiying whether to encrypt the header information. + * 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. @@ -327,6 +419,46 @@ public function setHeaders($var) return $this; } + /** + * The content type header to use for the check. The following + * configurations result in errors: + * 1. Content type is specified in both the `headers` field and the + * `content_type` field. + * 2. Request method is `GET` and `content_type` is not `TYPE_UNSPECIFIED` + * 3. Request method is `POST` and `content_type` is `TYPE_UNSPECIFIED`. + * 4. Request method is `POST` and a "Content-Type" header is provided via + * `headers` field. The `content_type` field should be used instead. + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.HttpCheck.ContentType content_type = 9; + * @return int + */ + public function getContentType() + { + return $this->content_type; + } + + /** + * The content type header to use for the check. The following + * configurations result in errors: + * 1. Content type is specified in both the `headers` field and the + * `content_type` field. + * 2. Request method is `GET` and `content_type` is not `TYPE_UNSPECIFIED` + * 3. Request method is `POST` and `content_type` is `TYPE_UNSPECIFIED`. + * 4. Request method is `POST` and a "Content-Type" header is provided via + * `headers` field. The `content_type` field should be used instead. + * + * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.HttpCheck.ContentType content_type = 9; + * @param int $var + * @return $this + */ + public function setContentType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\UptimeCheckConfig\HttpCheck\ContentType::class); + $this->content_type = $var; + + return $this; + } + /** * Boolean specifying whether to include SSL certificate validation as a * part of the Uptime check. Only applies to checks where @@ -359,6 +491,46 @@ public function setValidateSsl($var) return $this; } + /** + * The request body associated with the HTTP POST request. If `content_type` + * is `URL_ENCODED`, the body passed in must be URL-encoded. Users can + * provide a `Content-Length` header via the `headers` field or the API will + * do so. If the `request_method` is `GET` and `body` is not empty, the API + * will return an error. The maximum byte size is 1 megabyte. Note: As with + * all `bytes` fields, JSON representations are base64 encoded. e.g.: + * "foo=bar" in URL-encoded form is "foo%3Dbar" and in base64 encoding is + * "Zm9vJTI1M0RiYXI=". + * + * Generated from protobuf field bytes body = 10; + * @return string + */ + public function getBody() + { + return $this->body; + } + + /** + * The request body associated with the HTTP POST request. If `content_type` + * is `URL_ENCODED`, the body passed in must be URL-encoded. Users can + * provide a `Content-Length` header via the `headers` field or the API will + * do so. If the `request_method` is `GET` and `body` is not empty, the API + * will return an error. The maximum byte size is 1 megabyte. Note: As with + * all `bytes` fields, JSON representations are base64 encoded. e.g.: + * "foo=bar" in URL-encoded form is "foo%3Dbar" and in base64 encoding is + * "Zm9vJTI1M0RiYXI=". + * + * Generated from protobuf field bytes body = 10; + * @param string $var + * @return $this + */ + public function setBody($var) + { + GPBUtil::checkString($var, False); + $this->body = $var; + + return $this; + } + } // Adding a class alias for backwards compatibility with the previous class name. diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck/ContentType.php b/Monitoring/src/V3/UptimeCheckConfig/HttpCheck/ContentType.php similarity index 100% rename from owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck/ContentType.php rename to Monitoring/src/V3/UptimeCheckConfig/HttpCheck/ContentType.php diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck/RequestMethod.php b/Monitoring/src/V3/UptimeCheckConfig/HttpCheck/RequestMethod.php similarity index 100% rename from owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck/RequestMethod.php rename to Monitoring/src/V3/UptimeCheckConfig/HttpCheck/RequestMethod.php diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig_HttpCheck_ContentType.php b/Monitoring/src/V3/UptimeCheckConfig_HttpCheck_ContentType.php similarity index 100% rename from owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig_HttpCheck_ContentType.php rename to Monitoring/src/V3/UptimeCheckConfig_HttpCheck_ContentType.php diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig_HttpCheck_RequestMethod.php b/Monitoring/src/V3/UptimeCheckConfig_HttpCheck_RequestMethod.php similarity index 100% rename from owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig_HttpCheck_RequestMethod.php rename to Monitoring/src/V3/UptimeCheckConfig_HttpCheck_RequestMethod.php diff --git a/Monitoring/src/V3/UptimeCheckServiceClient.php b/Monitoring/src/V3/UptimeCheckServiceClient.php index 9f6db9832d7..1732de699c9 100644 --- a/Monitoring/src/V3/UptimeCheckServiceClient.php +++ b/Monitoring/src/V3/UptimeCheckServiceClient.php @@ -17,20 +17,18 @@ /* * GENERATED CODE WARNING - * This file was generated from the file - * https://github.com/google/googleapis/blob/master/google/monitoring/v3/uptime_service.proto - * and updates to that file get reflected here through a refresh process. + * Generated by gapic-generator-php from the file + * https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/uptime_service.proto + * Updates to the above are reflected here through a refresh process. */ namespace Google\Cloud\Monitoring\V3; use Google\Cloud\Monitoring\V3\Gapic\UptimeCheckServiceGapicClient; -/** - * {@inheritdoc} - */ +/** {@inheritdoc} */ class UptimeCheckServiceClient extends UptimeCheckServiceGapicClient { - // This class is intentionally empty, and is intended to hold manual - // additions to the generated {@see UptimeCheckServiceGapicClient} class. + // This class is intentionally empty, and is intended to hold manual additions to + // the generated {@see UptimeCheckServiceGapicClient} class. } diff --git a/Monitoring/src/V3/UptimeCheckServiceGrpcClient.php b/Monitoring/src/V3/UptimeCheckServiceGrpcClient.php index b5262344921..c2042a63883 100644 --- a/Monitoring/src/V3/UptimeCheckServiceGrpcClient.php +++ b/Monitoring/src/V3/UptimeCheckServiceGrpcClient.php @@ -45,6 +45,7 @@ public function __construct($hostname, $opts, $channel = null) { * @param \Google\Cloud\Monitoring\V3\ListUptimeCheckConfigsRequest $argument input argument * @param array $metadata metadata * @param array $options call options + * @return \Grpc\UnaryCall */ public function ListUptimeCheckConfigs(\Google\Cloud\Monitoring\V3\ListUptimeCheckConfigsRequest $argument, $metadata = [], $options = []) { @@ -59,6 +60,7 @@ public function ListUptimeCheckConfigs(\Google\Cloud\Monitoring\V3\ListUptimeChe * @param \Google\Cloud\Monitoring\V3\GetUptimeCheckConfigRequest $argument input argument * @param array $metadata metadata * @param array $options call options + * @return \Grpc\UnaryCall */ public function GetUptimeCheckConfig(\Google\Cloud\Monitoring\V3\GetUptimeCheckConfigRequest $argument, $metadata = [], $options = []) { @@ -73,6 +75,7 @@ public function GetUptimeCheckConfig(\Google\Cloud\Monitoring\V3\GetUptimeCheckC * @param \Google\Cloud\Monitoring\V3\CreateUptimeCheckConfigRequest $argument input argument * @param array $metadata metadata * @param array $options call options + * @return \Grpc\UnaryCall */ public function CreateUptimeCheckConfig(\Google\Cloud\Monitoring\V3\CreateUptimeCheckConfigRequest $argument, $metadata = [], $options = []) { @@ -90,6 +93,7 @@ public function CreateUptimeCheckConfig(\Google\Cloud\Monitoring\V3\CreateUptime * @param \Google\Cloud\Monitoring\V3\UpdateUptimeCheckConfigRequest $argument input argument * @param array $metadata metadata * @param array $options call options + * @return \Grpc\UnaryCall */ public function UpdateUptimeCheckConfig(\Google\Cloud\Monitoring\V3\UpdateUptimeCheckConfigRequest $argument, $metadata = [], $options = []) { @@ -106,6 +110,7 @@ public function UpdateUptimeCheckConfig(\Google\Cloud\Monitoring\V3\UpdateUptime * @param \Google\Cloud\Monitoring\V3\DeleteUptimeCheckConfigRequest $argument input argument * @param array $metadata metadata * @param array $options call options + * @return \Grpc\UnaryCall */ public function DeleteUptimeCheckConfig(\Google\Cloud\Monitoring\V3\DeleteUptimeCheckConfigRequest $argument, $metadata = [], $options = []) { @@ -120,6 +125,7 @@ public function DeleteUptimeCheckConfig(\Google\Cloud\Monitoring\V3\DeleteUptime * @param \Google\Cloud\Monitoring\V3\ListUptimeCheckIpsRequest $argument input argument * @param array $metadata metadata * @param array $options call options + * @return \Grpc\UnaryCall */ public function ListUptimeCheckIps(\Google\Cloud\Monitoring\V3\ListUptimeCheckIpsRequest $argument, $metadata = [], $options = []) { diff --git a/Monitoring/src/V3/WindowsBasedSli.php b/Monitoring/src/V3/WindowsBasedSli.php index 2471e72b077..13f42bc17e6 100644 --- a/Monitoring/src/V3/WindowsBasedSli.php +++ b/Monitoring/src/V3/WindowsBasedSli.php @@ -67,6 +67,11 @@ 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 @@ -88,13 +93,18 @@ public function setGoodBadMetricFilter($var) * 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 + * @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. * @@ -104,7 +114,7 @@ public function getGoodTotalRatioThreshold() */ public function setGoodTotalRatioThreshold($var) { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\WindowsBasedSli_PerformanceThreshold::class); + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\WindowsBasedSli\PerformanceThreshold::class); $this->writeOneof(2, $var); return $this; @@ -115,13 +125,18 @@ public function setGoodTotalRatioThreshold($var) * across returned streams. * * Generated from protobuf field .google.monitoring.v3.WindowsBasedSli.MetricRange metric_mean_in_range = 6; - * @return \Google\Cloud\Monitoring\V3\WindowsBasedSli\MetricRange + * @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. @@ -132,7 +147,7 @@ public function getMetricMeanInRange() */ public function setMetricMeanInRange($var) { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\WindowsBasedSli_MetricRange::class); + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\WindowsBasedSli\MetricRange::class); $this->writeOneof(6, $var); return $this; @@ -143,13 +158,18 @@ public function setMetricMeanInRange($var) * returned streams. * * Generated from protobuf field .google.monitoring.v3.WindowsBasedSli.MetricRange metric_sum_in_range = 7; - * @return \Google\Cloud\Monitoring\V3\WindowsBasedSli\MetricRange + * @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. @@ -160,7 +180,7 @@ public function getMetricSumInRange() */ public function setMetricSumInRange($var) { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\WindowsBasedSli_MetricRange::class); + GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\WindowsBasedSli\MetricRange::class); $this->writeOneof(7, $var); return $this; @@ -171,13 +191,23 @@ public function setMetricSumInRange($var) * fraction of a day and at least `60s`. * * Generated from protobuf field .google.protobuf.Duration window_period = 4; - * @return \Google\Protobuf\Duration + * @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`. diff --git a/Monitoring/src/V3/WindowsBasedSli/MetricRange.php b/Monitoring/src/V3/WindowsBasedSli/MetricRange.php index 030d428fe5e..3853a8633aa 100644 --- a/Monitoring/src/V3/WindowsBasedSli/MetricRange.php +++ b/Monitoring/src/V3/WindowsBasedSli/MetricRange.php @@ -10,7 +10,7 @@ /** * A `MetricRange` is used when each window is good when the value x of a - * single `TimeSeries` satisfies `range.min <= x < range.max`. The provided + * single `TimeSeries` satisfies `range.min <= x <= range.max`. The provided * `TimeSeries` must have `ValueType = INT64` or `ValueType = DOUBLE` and * `MetricKind = GAUGE`. * @@ -85,13 +85,23 @@ public function setTimeSeries($var) * to an infinite value. * * Generated from protobuf field .google.monitoring.v3.Range range = 4; - * @return \Google\Cloud\Monitoring\V3\Range + * @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. diff --git a/Monitoring/src/V3/WindowsBasedSli/PerformanceThreshold.php b/Monitoring/src/V3/WindowsBasedSli/PerformanceThreshold.php index 1dd600370b2..5e7ab1c9a75 100644 --- a/Monitoring/src/V3/WindowsBasedSli/PerformanceThreshold.php +++ b/Monitoring/src/V3/WindowsBasedSli/PerformanceThreshold.php @@ -47,13 +47,18 @@ public function __construct($data = NULL) { * `RequestBasedSli` to evaluate to judge window quality. * * Generated from protobuf field .google.monitoring.v3.RequestBasedSli performance = 1; - * @return \Google\Cloud\Monitoring\V3\RequestBasedSli + * @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. * @@ -73,13 +78,18 @@ public function setPerformance($var) * `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 + * @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. * diff --git a/owl-bot-staging/Monitoring/v3/src/V3/gapic_metadata.json b/Monitoring/src/V3/gapic_metadata.json similarity index 100% rename from owl-bot-staging/Monitoring/v3/src/V3/gapic_metadata.json rename to Monitoring/src/V3/gapic_metadata.json diff --git a/Monitoring/src/V3/resources/alert_policy_service_client_config.json b/Monitoring/src/V3/resources/alert_policy_service_client_config.json index d6101ccaae8..f2664a2cd62 100644 --- a/Monitoring/src/V3/resources/alert_policy_service_client_config.json +++ b/Monitoring/src/V3/resources/alert_policy_service_client_config.json @@ -1,51 +1,69 @@ { - "interfaces": { - "google.monitoring.v3.AlertPolicyService": { - "retry_codes": { - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ], - "non_idempotent": [] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 600000 + "interfaces": { + "google.monitoring.v3.AlertPolicyService": { + "retry_codes": { + "no_retry_codes": [], + "no_retry_1_codes": [], + "retry_policy_6_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_1_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_6_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": { + "CreateAlertPolicy": { + "timeout_millis": 30000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteAlertPolicy": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_6_codes", + "retry_params_name": "retry_policy_6_params" + }, + "GetAlertPolicy": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_6_codes", + "retry_params_name": "retry_policy_6_params" + }, + "ListAlertPolicies": { + "timeout_millis": 30000, + "retry_codes_name": "retry_policy_6_codes", + "retry_params_name": "retry_policy_6_params" + }, + "UpdateAlertPolicy": { + "timeout_millis": 30000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } } - }, - "methods": { - "ListAlertPolicies": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "GetAlertPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "CreateAlertPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteAlertPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "UpdateAlertPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } } - } } 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 e0d51cd0398..67393699720 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 @@ -3,9 +3,10 @@ return [ 'interfaces' => [ 'google.monitoring.v3.AlertPolicyService' => [ - 'ListAlertPolicies' => [ - 'method' => 'get', + 'CreateAlertPolicy' => [ + 'method' => 'post', 'uriTemplate' => '/v3/{name=projects/*}/alertPolicies', + 'body' => 'alert_policy', 'placeholders' => [ 'name' => [ 'getters' => [ @@ -14,8 +15,8 @@ ], ], ], - 'GetAlertPolicy' => [ - 'method' => 'get', + 'DeleteAlertPolicy' => [ + 'method' => 'delete', 'uriTemplate' => '/v3/{name=projects/*/alertPolicies/*}', 'placeholders' => [ 'name' => [ @@ -25,10 +26,9 @@ ], ], ], - 'CreateAlertPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v3/{name=projects/*}/alertPolicies', - 'body' => 'alert_policy', + 'GetAlertPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{name=projects/*/alertPolicies/*}', 'placeholders' => [ 'name' => [ 'getters' => [ @@ -37,9 +37,9 @@ ], ], ], - 'DeleteAlertPolicy' => [ - 'method' => 'delete', - 'uriTemplate' => '/v3/{name=projects/*/alertPolicies/*}', + 'ListAlertPolicies' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{name=projects/*}/alertPolicies', 'placeholders' => [ 'name' => [ 'getters' => [ diff --git a/Monitoring/src/V3/resources/group_service_client_config.json b/Monitoring/src/V3/resources/group_service_client_config.json index a57878c2ece..3701e6baf28 100644 --- a/Monitoring/src/V3/resources/group_service_client_config.json +++ b/Monitoring/src/V3/resources/group_service_client_config.json @@ -1,56 +1,86 @@ { - "interfaces": { - "google.monitoring.v3.GroupService": { - "retry_codes": { - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ], - "non_idempotent": [] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 600000 + "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" + } + } } - }, - "methods": { - "ListGroups": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "GetGroup": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "CreateGroup": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateGroup": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "DeleteGroup": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "ListGroupMembers": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - } - } } - } } diff --git a/Monitoring/src/V3/resources/group_service_descriptor_config.php b/Monitoring/src/V3/resources/group_service_descriptor_config.php index f9adbe72c89..23b49cfcfbc 100644 --- a/Monitoring/src/V3/resources/group_service_descriptor_config.php +++ b/Monitoring/src/V3/resources/group_service_descriptor_config.php @@ -3,24 +3,24 @@ return [ 'interfaces' => [ 'google.monitoring.v3.GroupService' => [ - 'ListGroups' => [ + 'ListGroupMembers' => [ 'pageStreaming' => [ 'requestPageTokenGetMethod' => 'getPageToken', 'requestPageTokenSetMethod' => 'setPageToken', 'requestPageSizeGetMethod' => 'getPageSize', 'requestPageSizeSetMethod' => 'setPageSize', 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getGroup', + 'resourcesGetMethod' => 'getMembers', ], ], - 'ListGroupMembers' => [ + 'ListGroups' => [ 'pageStreaming' => [ 'requestPageTokenGetMethod' => 'getPageToken', 'requestPageTokenSetMethod' => 'setPageToken', 'requestPageSizeGetMethod' => 'getPageSize', 'requestPageSizeSetMethod' => 'setPageSize', 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getMembers', + 'resourcesGetMethod' => 'getGroup', ], ], ], 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 19fdff918de..1d828ba8b14 100644 --- a/Monitoring/src/V3/resources/group_service_rest_client_config.php +++ b/Monitoring/src/V3/resources/group_service_rest_client_config.php @@ -3,9 +3,10 @@ return [ 'interfaces' => [ 'google.monitoring.v3.GroupService' => [ - 'ListGroups' => [ - 'method' => 'get', + 'CreateGroup' => [ + 'method' => 'post', 'uriTemplate' => '/v3/{name=projects/*}/groups', + 'body' => 'group', 'placeholders' => [ 'name' => [ 'getters' => [ @@ -14,8 +15,8 @@ ], ], ], - 'GetGroup' => [ - 'method' => 'get', + 'DeleteGroup' => [ + 'method' => 'delete', 'uriTemplate' => '/v3/{name=projects/*/groups/*}', 'placeholders' => [ 'name' => [ @@ -25,10 +26,9 @@ ], ], ], - 'CreateGroup' => [ - 'method' => 'post', - 'uriTemplate' => '/v3/{name=projects/*}/groups', - 'body' => 'group', + 'GetGroup' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{name=projects/*/groups/*}', 'placeholders' => [ 'name' => [ 'getters' => [ @@ -37,22 +37,20 @@ ], ], ], - 'UpdateGroup' => [ - 'method' => 'put', - 'uriTemplate' => '/v3/{group.name=projects/*/groups/*}', - 'body' => 'group', + 'ListGroupMembers' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{name=projects/*/groups/*}/members', 'placeholders' => [ - 'group.name' => [ + 'name' => [ 'getters' => [ - 'getGroup', 'getName', ], ], ], ], - 'DeleteGroup' => [ - 'method' => 'delete', - 'uriTemplate' => '/v3/{name=projects/*/groups/*}', + 'ListGroups' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{name=projects/*}/groups', 'placeholders' => [ 'name' => [ 'getters' => [ @@ -61,12 +59,14 @@ ], ], ], - 'ListGroupMembers' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/{name=projects/*/groups/*}/members', + 'UpdateGroup' => [ + 'method' => 'put', + 'uriTemplate' => '/v3/{group.name=projects/*/groups/*}', + 'body' => 'group', 'placeholders' => [ - 'name' => [ + 'group.name' => [ 'getters' => [ + 'getGroup', 'getName', ], ], diff --git a/Monitoring/src/V3/resources/metric_service_client_config.json b/Monitoring/src/V3/resources/metric_service_client_config.json index b3d5fa2b7ac..37d238c0584 100644 --- a/Monitoring/src/V3/resources/metric_service_client_config.json +++ b/Monitoring/src/V3/resources/metric_service_client_config.json @@ -1,66 +1,101 @@ { - "interfaces": { - "google.monitoring.v3.MetricService": { - "retry_codes": { - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ], - "non_idempotent": [] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 30000, - "rpc_timeout_multiplier": 1.3, - "max_rpc_timeout_millis": 90000, - "total_timeout_millis": 600000 + "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" + } + } } - }, - "methods": { - "ListMonitoredResourceDescriptors": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "GetMonitoredResourceDescriptor": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "ListMetricDescriptors": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "GetMetricDescriptor": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "CreateMetricDescriptor": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteMetricDescriptor": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "ListTimeSeries": { - "timeout_millis": 90000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "CreateTimeSeries": { - "timeout_millis": 12000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } } - } } diff --git a/Monitoring/src/V3/resources/metric_service_descriptor_config.php b/Monitoring/src/V3/resources/metric_service_descriptor_config.php index 8e94f30dfab..e18d6331cf5 100644 --- a/Monitoring/src/V3/resources/metric_service_descriptor_config.php +++ b/Monitoring/src/V3/resources/metric_service_descriptor_config.php @@ -3,24 +3,24 @@ return [ 'interfaces' => [ 'google.monitoring.v3.MetricService' => [ - 'ListMonitoredResourceDescriptors' => [ + 'ListMetricDescriptors' => [ 'pageStreaming' => [ 'requestPageTokenGetMethod' => 'getPageToken', 'requestPageTokenSetMethod' => 'setPageToken', 'requestPageSizeGetMethod' => 'getPageSize', 'requestPageSizeSetMethod' => 'setPageSize', 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getResourceDescriptors', + 'resourcesGetMethod' => 'getMetricDescriptors', ], ], - 'ListMetricDescriptors' => [ + 'ListMonitoredResourceDescriptors' => [ 'pageStreaming' => [ 'requestPageTokenGetMethod' => 'getPageToken', 'requestPageTokenSetMethod' => 'setPageToken', 'requestPageSizeGetMethod' => 'getPageSize', 'requestPageSizeSetMethod' => 'setPageSize', 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getMetricDescriptors', + 'resourcesGetMethod' => 'getResourceDescriptors', ], ], 'ListTimeSeries' => [ 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 d47cc126c82..c7ed1143106 100644 --- a/Monitoring/src/V3/resources/metric_service_rest_client_config.php +++ b/Monitoring/src/V3/resources/metric_service_rest_client_config.php @@ -3,9 +3,10 @@ return [ 'interfaces' => [ 'google.monitoring.v3.MetricService' => [ - 'ListMonitoredResourceDescriptors' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/{name=projects/*}/monitoredResourceDescriptors', + 'CreateMetricDescriptor' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{name=projects/*}/metricDescriptors', + 'body' => 'metric_descriptor', 'placeholders' => [ 'name' => [ 'getters' => [ @@ -14,9 +15,10 @@ ], ], ], - 'GetMonitoredResourceDescriptor' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/{name=projects/*/monitoredResourceDescriptors/**}', + 'CreateServiceTimeSeries' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{name=projects/*}/timeSeries:createService', + 'body' => '*', 'placeholders' => [ 'name' => [ 'getters' => [ @@ -25,9 +27,21 @@ ], ], ], - 'ListMetricDescriptors' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/{name=projects/*}/metricDescriptors', + 'CreateTimeSeries' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{name=projects/*}/timeSeries', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteMetricDescriptor' => [ + 'method' => 'delete', + 'uriTemplate' => '/v3/{name=projects/*/metricDescriptors/**}', 'placeholders' => [ 'name' => [ 'getters' => [ @@ -47,10 +61,9 @@ ], ], ], - 'CreateMetricDescriptor' => [ - 'method' => 'post', - 'uriTemplate' => '/v3/{name=projects/*}/metricDescriptors', - 'body' => 'metric_descriptor', + 'GetMonitoredResourceDescriptor' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{name=projects/*/monitoredResourceDescriptors/**}', 'placeholders' => [ 'name' => [ 'getters' => [ @@ -59,9 +72,9 @@ ], ], ], - 'DeleteMetricDescriptor' => [ - 'method' => 'delete', - 'uriTemplate' => '/v3/{name=projects/*/metricDescriptors/**}', + 'ListMetricDescriptors' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{name=projects/*}/metricDescriptors', 'placeholders' => [ 'name' => [ 'getters' => [ @@ -70,9 +83,9 @@ ], ], ], - 'ListTimeSeries' => [ + 'ListMonitoredResourceDescriptors' => [ 'method' => 'get', - 'uriTemplate' => '/v3/{name=projects/*}/timeSeries', + 'uriTemplate' => '/v3/{name=projects/*}/monitoredResourceDescriptors', 'placeholders' => [ 'name' => [ 'getters' => [ @@ -81,10 +94,29 @@ ], ], ], - 'CreateTimeSeries' => [ - 'method' => 'post', + 'ListTimeSeries' => [ + 'method' => 'get', 'uriTemplate' => '/v3/{name=projects/*}/timeSeries', - 'body' => '*', + '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' => [ @@ -92,6 +124,11 @@ ], ], ], + 'queryParams' => [ + 'filter', + 'interval', + 'view', + ], ], ], ], diff --git a/Monitoring/src/V3/resources/notification_channel_service_client_config.json b/Monitoring/src/V3/resources/notification_channel_service_client_config.json index 5fddaef1323..90437e7f64c 100644 --- a/Monitoring/src/V3/resources/notification_channel_service_client_config.json +++ b/Monitoring/src/V3/resources/notification_channel_service_client_config.json @@ -1,76 +1,94 @@ { - "interfaces": { - "google.monitoring.v3.NotificationChannelService": { - "retry_codes": { - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ], - "non_idempotent": [] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 600000 + "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" + } + } } - }, - "methods": { - "ListNotificationChannelDescriptors": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "GetNotificationChannelDescriptor": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "ListNotificationChannels": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "GetNotificationChannel": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "CreateNotificationChannel": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateNotificationChannel": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteNotificationChannel": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "SendNotificationChannelVerificationCode": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetNotificationChannelVerificationCode": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "VerifyNotificationChannel": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - } - } } - } } 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 4825d340264..72d0fce4308 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 @@ -3,9 +3,10 @@ return [ 'interfaces' => [ 'google.monitoring.v3.NotificationChannelService' => [ - 'ListNotificationChannelDescriptors' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/{name=projects/*}/notificationChannelDescriptors', + 'CreateNotificationChannel' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{name=projects/*}/notificationChannels', + 'body' => 'notification_channel', 'placeholders' => [ 'name' => [ 'getters' => [ @@ -14,9 +15,9 @@ ], ], ], - 'GetNotificationChannelDescriptor' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/{name=projects/*/notificationChannelDescriptors/*}', + 'DeleteNotificationChannel' => [ + 'method' => 'delete', + 'uriTemplate' => '/v3/{name=projects/*/notificationChannels/*}', 'placeholders' => [ 'name' => [ 'getters' => [ @@ -25,9 +26,9 @@ ], ], ], - 'ListNotificationChannels' => [ + 'GetNotificationChannel' => [ 'method' => 'get', - 'uriTemplate' => '/v3/{name=projects/*}/notificationChannels', + 'uriTemplate' => '/v3/{name=projects/*/notificationChannels/*}', 'placeholders' => [ 'name' => [ 'getters' => [ @@ -36,9 +37,9 @@ ], ], ], - 'GetNotificationChannel' => [ + 'GetNotificationChannelDescriptor' => [ 'method' => 'get', - 'uriTemplate' => '/v3/{name=projects/*/notificationChannels/*}', + 'uriTemplate' => '/v3/{name=projects/*/notificationChannelDescriptors/*}', 'placeholders' => [ 'name' => [ 'getters' => [ @@ -47,10 +48,10 @@ ], ], ], - 'CreateNotificationChannel' => [ + 'GetNotificationChannelVerificationCode' => [ 'method' => 'post', - 'uriTemplate' => '/v3/{name=projects/*}/notificationChannels', - 'body' => 'notification_channel', + 'uriTemplate' => '/v3/{name=projects/*/notificationChannels/*}:getVerificationCode', + 'body' => '*', 'placeholders' => [ 'name' => [ 'getters' => [ @@ -59,22 +60,20 @@ ], ], ], - 'UpdateNotificationChannel' => [ - 'method' => 'patch', - 'uriTemplate' => '/v3/{notification_channel.name=projects/*/notificationChannels/*}', - 'body' => 'notification_channel', + 'ListNotificationChannelDescriptors' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{name=projects/*}/notificationChannelDescriptors', 'placeholders' => [ - 'notification_channel.name' => [ + 'name' => [ 'getters' => [ - 'getNotificationChannel', 'getName', ], ], ], ], - 'DeleteNotificationChannel' => [ - 'method' => 'delete', - 'uriTemplate' => '/v3/{name=projects/*/notificationChannels/*}', + 'ListNotificationChannels' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{name=projects/*}/notificationChannels', 'placeholders' => [ 'name' => [ 'getters' => [ @@ -95,13 +94,14 @@ ], ], ], - 'GetNotificationChannelVerificationCode' => [ - 'method' => 'post', - 'uriTemplate' => '/v3/{name=projects/*/notificationChannels/*}:getVerificationCode', - 'body' => '*', + 'UpdateNotificationChannel' => [ + 'method' => 'patch', + 'uriTemplate' => '/v3/{notification_channel.name=projects/*/notificationChannels/*}', + 'body' => 'notification_channel', 'placeholders' => [ - 'name' => [ + 'notification_channel.name' => [ 'getters' => [ + 'getNotificationChannel', 'getName', ], ], diff --git a/owl-bot-staging/Monitoring/v3/src/V3/resources/query_service_client_config.json b/Monitoring/src/V3/resources/query_service_client_config.json similarity index 100% rename from owl-bot-staging/Monitoring/v3/src/V3/resources/query_service_client_config.json rename to Monitoring/src/V3/resources/query_service_client_config.json diff --git a/owl-bot-staging/Monitoring/v3/src/V3/resources/query_service_descriptor_config.php b/Monitoring/src/V3/resources/query_service_descriptor_config.php similarity index 100% rename from owl-bot-staging/Monitoring/v3/src/V3/resources/query_service_descriptor_config.php rename to Monitoring/src/V3/resources/query_service_descriptor_config.php diff --git a/owl-bot-staging/Monitoring/v3/src/V3/resources/query_service_rest_client_config.php b/Monitoring/src/V3/resources/query_service_rest_client_config.php similarity index 100% rename from owl-bot-staging/Monitoring/v3/src/V3/resources/query_service_rest_client_config.php rename to Monitoring/src/V3/resources/query_service_rest_client_config.php diff --git a/Monitoring/src/V3/resources/service_monitoring_service_client_config.json b/Monitoring/src/V3/resources/service_monitoring_service_client_config.json index dfa25dc0bb1..daae71bdd45 100644 --- a/Monitoring/src/V3/resources/service_monitoring_service_client_config.json +++ b/Monitoring/src/V3/resources/service_monitoring_service_client_config.json @@ -1,76 +1,94 @@ { - "interfaces": { - "google.monitoring.v3.ServiceMonitoringService": { - "retry_codes": { - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ], - "non_idempotent": [] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 600000 + "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" + } + } } - }, - "methods": { - "CreateService": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetService": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "ListServices": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "UpdateService": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteService": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "CreateServiceLevelObjective": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetServiceLevelObjective": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "ListServiceLevelObjectives": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "UpdateServiceLevelObjective": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteServiceLevelObjective": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - } - } } - } } 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 c119d2b060e..dec870024e1 100644 --- a/Monitoring/src/V3/resources/service_monitoring_service_descriptor_config.php +++ b/Monitoring/src/V3/resources/service_monitoring_service_descriptor_config.php @@ -3,24 +3,24 @@ return [ 'interfaces' => [ 'google.monitoring.v3.ServiceMonitoringService' => [ - 'ListServices' => [ + 'ListServiceLevelObjectives' => [ 'pageStreaming' => [ 'requestPageTokenGetMethod' => 'getPageToken', 'requestPageTokenSetMethod' => 'setPageToken', 'requestPageSizeGetMethod' => 'getPageSize', 'requestPageSizeSetMethod' => 'setPageSize', 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getServices', + 'resourcesGetMethod' => 'getServiceLevelObjectives', ], ], - 'ListServiceLevelObjectives' => [ + 'ListServices' => [ 'pageStreaming' => [ 'requestPageTokenGetMethod' => 'getPageToken', 'requestPageTokenSetMethod' => 'setPageToken', 'requestPageSizeGetMethod' => 'getPageSize', 'requestPageSizeSetMethod' => 'setPageSize', 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getServiceLevelObjectives', + 'resourcesGetMethod' => 'getServices', ], ], ], 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 de2967987d9..cea286539d5 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 @@ -15,20 +15,10 @@ ], ], ], - 'GetService' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/{name=*/*/services/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListServices' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/{parent=*/*}/services', + 'CreateServiceLevelObjective' => [ + 'method' => 'post', + 'uriTemplate' => '/v3/{parent=*/*/services/*}/serviceLevelObjectives', + 'body' => 'service_level_objective', 'placeholders' => [ 'parent' => [ 'getters' => [ @@ -37,22 +27,20 @@ ], ], ], - 'UpdateService' => [ - 'method' => 'patch', - 'uriTemplate' => '/v3/{service.name=*/*/services/*}', - 'body' => 'service', + 'DeleteService' => [ + 'method' => 'delete', + 'uriTemplate' => '/v3/{name=*/*/services/*}', 'placeholders' => [ - 'service.name' => [ + 'name' => [ 'getters' => [ - 'getService', 'getName', ], ], ], ], - 'DeleteService' => [ + 'DeleteServiceLevelObjective' => [ 'method' => 'delete', - 'uriTemplate' => '/v3/{name=*/*/services/*}', + 'uriTemplate' => '/v3/{name=*/*/services/*/serviceLevelObjectives/*}', 'placeholders' => [ 'name' => [ 'getters' => [ @@ -61,14 +49,13 @@ ], ], ], - 'CreateServiceLevelObjective' => [ - 'method' => 'post', - 'uriTemplate' => '/v3/{parent=*/*/services/*}/serviceLevelObjectives', - 'body' => 'service_level_objective', + 'GetService' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{name=*/*/services/*}', 'placeholders' => [ - 'parent' => [ + 'name' => [ 'getters' => [ - 'getParent', + 'getName', ], ], ], @@ -95,25 +82,38 @@ ], ], ], - 'UpdateServiceLevelObjective' => [ + 'ListServices' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/{parent=*/*}/services', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateService' => [ 'method' => 'patch', - 'uriTemplate' => '/v3/{service_level_objective.name=*/*/services/*/serviceLevelObjectives/*}', - 'body' => 'service_level_objective', + 'uriTemplate' => '/v3/{service.name=*/*/services/*}', + 'body' => 'service', 'placeholders' => [ - 'service_level_objective.name' => [ + 'service.name' => [ 'getters' => [ - 'getServiceLevelObjective', + 'getService', 'getName', ], ], ], ], - 'DeleteServiceLevelObjective' => [ - 'method' => 'delete', - 'uriTemplate' => '/v3/{name=*/*/services/*/serviceLevelObjectives/*}', + 'UpdateServiceLevelObjective' => [ + 'method' => 'patch', + 'uriTemplate' => '/v3/{service_level_objective.name=*/*/services/*/serviceLevelObjectives/*}', + 'body' => 'service_level_objective', 'placeholders' => [ - 'name' => [ + 'service_level_objective.name' => [ 'getters' => [ + 'getServiceLevelObjective', 'getName', ], ], diff --git a/Monitoring/src/V3/resources/uptime_check_service_client_config.json b/Monitoring/src/V3/resources/uptime_check_service_client_config.json index 11705881bb1..4e19af23389 100644 --- a/Monitoring/src/V3/resources/uptime_check_service_client_config.json +++ b/Monitoring/src/V3/resources/uptime_check_service_client_config.json @@ -1,56 +1,74 @@ { - "interfaces": { - "google.monitoring.v3.UptimeCheckService": { - "retry_codes": { - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ], - "non_idempotent": [] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 600000 + "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" + } + } } - }, - "methods": { - "ListUptimeCheckConfigs": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "GetUptimeCheckConfig": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "CreateUptimeCheckConfig": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateUptimeCheckConfig": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteUptimeCheckConfig": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "ListUptimeCheckIps": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - } - } } - } } 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 fdef0614f2d..7e11767438d 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 @@ -3,9 +3,10 @@ return [ 'interfaces' => [ 'google.monitoring.v3.UptimeCheckService' => [ - 'ListUptimeCheckConfigs' => [ - 'method' => 'get', + 'CreateUptimeCheckConfig' => [ + 'method' => 'post', 'uriTemplate' => '/v3/{parent=projects/*}/uptimeCheckConfigs', + 'body' => 'uptime_check_config', 'placeholders' => [ 'parent' => [ 'getters' => [ @@ -14,6 +15,17 @@ ], ], ], + 'DeleteUptimeCheckConfig' => [ + 'method' => 'delete', + 'uriTemplate' => '/v3/{name=projects/*/uptimeCheckConfigs/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'GetUptimeCheckConfig' => [ 'method' => 'get', 'uriTemplate' => '/v3/{name=projects/*/uptimeCheckConfigs/*}', @@ -25,10 +37,9 @@ ], ], ], - 'CreateUptimeCheckConfig' => [ - 'method' => 'post', + 'ListUptimeCheckConfigs' => [ + 'method' => 'get', 'uriTemplate' => '/v3/{parent=projects/*}/uptimeCheckConfigs', - 'body' => 'uptime_check_config', 'placeholders' => [ 'parent' => [ 'getters' => [ @@ -37,6 +48,10 @@ ], ], ], + 'ListUptimeCheckIps' => [ + 'method' => 'get', + 'uriTemplate' => '/v3/uptimeCheckIps', + ], 'UpdateUptimeCheckConfig' => [ 'method' => 'patch', 'uriTemplate' => '/v3/{uptime_check_config.name=projects/*/uptimeCheckConfigs/*}', @@ -50,21 +65,6 @@ ], ], ], - 'DeleteUptimeCheckConfig' => [ - 'method' => 'delete', - 'uriTemplate' => '/v3/{name=projects/*/uptimeCheckConfigs/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListUptimeCheckIps' => [ - 'method' => 'get', - 'uriTemplate' => '/v3/uptimeCheckIps', - ], ], ], ]; diff --git a/Monitoring/tests/Unit/V3/AlertPolicyServiceClientTest.php b/Monitoring/tests/Unit/V3/AlertPolicyServiceClientTest.php index c1e0744ea68..dd241c19e08 100644 --- a/Monitoring/tests/Unit/V3/AlertPolicyServiceClientTest.php +++ b/Monitoring/tests/Unit/V3/AlertPolicyServiceClientTest.php @@ -22,20 +22,22 @@ namespace Google\Cloud\Monitoring\Tests\Unit\V3; -use Google\Cloud\Monitoring\V3\AlertPolicyServiceClient; use Google\ApiCore\ApiException; + use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; + use Google\Cloud\Monitoring\V3\AlertPolicy; +use Google\Cloud\Monitoring\V3\AlertPolicyServiceClient; use Google\Cloud\Monitoring\V3\ListAlertPoliciesResponse; -use Google\Protobuf\Any; use Google\Protobuf\GPBEmpty; use Google\Rpc\Code; use stdClass; /** * @group monitoring + * * @group gapic */ class AlertPolicyServiceClientTest extends GeneratedTest @@ -53,9 +55,7 @@ private function createTransport($deserialize = null) */ private function createCredentials() { - return $this->getMockBuilder(CredentialsWrapper::class) - ->disableOriginalConstructor() - ->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); } /** @@ -66,84 +66,74 @@ private function createClient(array $options = []) $options += [ 'credentials' => $this->createCredentials(), ]; - return new AlertPolicyServiceClient($options); } /** * @test */ - public function listAlertPoliciesTest() + public function createAlertPolicyTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $alertPoliciesElement = new AlertPolicy(); - $alertPolicies = [$alertPoliciesElement]; - $expectedResponse = new ListAlertPoliciesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setAlertPolicies($alertPolicies); + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $expectedResponse = new AlertPolicy(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->projectName('[PROJECT]'); - - $response = $client->listAlertPolicies($formattedName); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getAlertPolicies()[0], $resources[0]); - + $name = 'name3373707'; + $alertPolicy = new AlertPolicy(); + $response = $client->createAlertPolicy($name, $alertPolicy); + $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.AlertPolicyService/ListAlertPolicies', $actualFuncCall); - + $this->assertSame('/google.monitoring.v3.AlertPolicyService/CreateAlertPolicy', $actualFuncCall); $actualValue = $actualRequestObject->getName(); - - $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertProtobufEquals($name, $actualValue); + $actualValue = $actualRequestObject->getAlertPolicy(); + $this->assertProtobufEquals($alertPolicy, $actualValue); $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function listAlertPoliciesExceptionTest() + public function createAlertPolicyExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->projectName('[PROJECT]'); - + $name = 'name3373707'; + $alertPolicy = new AlertPolicy(); try { - $client->listAlertPolicies($formattedName); + $client->createAlertPolicy($name, $alertPolicy); // If the $client method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); } - // Call popReceivedCalls to ensure the stub is exhausted $transport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); @@ -152,73 +142,59 @@ public function listAlertPoliciesExceptionTest() /** * @test */ - public function getAlertPolicyTest() + public function deleteAlertPolicyTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $expectedResponse = new AlertPolicy(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); + $expectedResponse = new GPBEmpty(); $transport->addResponse($expectedResponse); - // Mock request $formattedName = $client->alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); - - $response = $client->getAlertPolicy($formattedName); - $this->assertEquals($expectedResponse, $response); + $client->deleteAlertPolicy($formattedName); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.AlertPolicyService/GetAlertPolicy', $actualFuncCall); - + $this->assertSame('/google.monitoring.v3.AlertPolicyService/DeleteAlertPolicy', $actualFuncCall); $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function getAlertPolicyExceptionTest() + public function deleteAlertPolicyExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request $formattedName = $client->alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); - try { - $client->getAlertPolicy($formattedName); + $client->deleteAlertPolicy($formattedName); // If the $client method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); } - // Call popReceivedCalls to ensure the stub is exhausted $transport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); @@ -227,13 +203,13 @@ public function getAlertPolicyExceptionTest() /** * @test */ - public function createAlertPolicyTest() + public function getAlertPolicyTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response $name2 = 'name2-1052831874'; $displayName = 'displayName1615086568'; @@ -241,64 +217,50 @@ public function createAlertPolicyTest() $expectedResponse->setName($name2); $expectedResponse->setDisplayName($displayName); $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->projectName('[PROJECT]'); - $alertPolicy = new AlertPolicy(); - - $response = $client->createAlertPolicy($formattedName, $alertPolicy); + $formattedName = $client->alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); + $response = $client->getAlertPolicy($formattedName); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.AlertPolicyService/CreateAlertPolicy', $actualFuncCall); - + $this->assertSame('/google.monitoring.v3.AlertPolicyService/GetAlertPolicy', $actualFuncCall); $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getAlertPolicy(); - - $this->assertProtobufEquals($alertPolicy, $actualValue); - $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function createAlertPolicyExceptionTest() + public function getAlertPolicyExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->projectName('[PROJECT]'); - $alertPolicy = new AlertPolicy(); - + $formattedName = $client->alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); try { - $client->createAlertPolicy($formattedName, $alertPolicy); + $client->getAlertPolicy($formattedName); // If the $client method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); } - // Call popReceivedCalls to ensure the stub is exhausted $transport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); @@ -307,68 +269,72 @@ public function createAlertPolicyExceptionTest() /** * @test */ - public function deleteAlertPolicyTest() + public function listAlertPoliciesTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); + $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 - $formattedName = $client->alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); - - $client->deleteAlertPolicy($formattedName); + $name = 'name3373707'; + $response = $client->listAlertPolicies($name); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getAlertPolicies()[0], $resources[0]); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.AlertPolicyService/DeleteAlertPolicy', $actualFuncCall); - + $this->assertSame('/google.monitoring.v3.AlertPolicyService/ListAlertPolicies', $actualFuncCall); $actualValue = $actualRequestObject->getName(); - - $this->assertProtobufEquals($formattedName, $actualValue); - + $this->assertProtobufEquals($name, $actualValue); $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function deleteAlertPolicyExceptionTest() + public function listAlertPoliciesExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); - + $name = 'name3373707'; try { - $client->deleteAlertPolicy($formattedName); + $client->listAlertPolicies($name); // If the $client method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); } - // Call popReceivedCalls to ensure the stub is exhausted $transport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); @@ -380,10 +346,10 @@ public function deleteAlertPolicyExceptionTest() public function updateAlertPolicyTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response $name = 'name3373707'; $displayName = 'displayName1615086568'; @@ -391,10 +357,8 @@ public function updateAlertPolicyTest() $expectedResponse->setName($name); $expectedResponse->setDisplayName($displayName); $transport->addResponse($expectedResponse); - // Mock request $alertPolicy = new AlertPolicy(); - $response = $client->updateAlertPolicy($alertPolicy); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -402,11 +366,8 @@ public function updateAlertPolicyTest() $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()); } @@ -416,25 +377,22 @@ public function updateAlertPolicyTest() public function updateAlertPolicyExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request $alertPolicy = new AlertPolicy(); - try { $client->updateAlertPolicy($alertPolicy); // If the $client method call did not throw, fail the test @@ -443,7 +401,6 @@ public function updateAlertPolicyExceptionTest() $this->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/Monitoring/tests/Unit/V3/GroupServiceClientTest.php b/Monitoring/tests/Unit/V3/GroupServiceClientTest.php index 295f7c82520..8fe1c701d13 100644 --- a/Monitoring/tests/Unit/V3/GroupServiceClientTest.php +++ b/Monitoring/tests/Unit/V3/GroupServiceClientTest.php @@ -22,22 +22,24 @@ namespace Google\Cloud\Monitoring\Tests\Unit\V3; -use Google\Cloud\Monitoring\V3\GroupServiceClient; +use Google\Api\MonitoredResource; + use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\Testing\GeneratedTest; + use Google\ApiCore\Testing\MockTransport; -use Google\Api\MonitoredResource; use Google\Cloud\Monitoring\V3\Group; +use Google\Cloud\Monitoring\V3\GroupServiceClient; use Google\Cloud\Monitoring\V3\ListGroupMembersResponse; use Google\Cloud\Monitoring\V3\ListGroupsResponse; -use Google\Protobuf\Any; use Google\Protobuf\GPBEmpty; use Google\Rpc\Code; use stdClass; /** * @group monitoring + * * @group gapic */ class GroupServiceClientTest extends GeneratedTest @@ -55,9 +57,7 @@ private function createTransport($deserialize = null) */ private function createCredentials() { - return $this->getMockBuilder(CredentialsWrapper::class) - ->disableOriginalConstructor() - ->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); } /** @@ -68,84 +68,80 @@ private function createClient(array $options = []) $options += [ 'credentials' => $this->createCredentials(), ]; - return new GroupServiceClient($options); } /** * @test */ - public function listGroupsTest() + public function createGroupTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $groupElement = new Group(); - $group = [$groupElement]; - $expectedResponse = new ListGroupsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setGroup($group); + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $parentName = 'parentName1015022848'; + $filter = 'filter-1274492040'; + $isCluster = false; + $expectedResponse = new Group(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setParentName($parentName); + $expectedResponse->setFilter($filter); + $expectedResponse->setIsCluster($isCluster); $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->projectName('[PROJECT]'); - - $response = $client->listGroups($formattedName); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getGroup()[0], $resources[0]); - + $name = 'name3373707'; + $group = new Group(); + $response = $client->createGroup($name, $group); + $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.GroupService/ListGroups', $actualFuncCall); - + $this->assertSame('/google.monitoring.v3.GroupService/CreateGroup', $actualFuncCall); $actualValue = $actualRequestObject->getName(); - - $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertProtobufEquals($name, $actualValue); + $actualValue = $actualRequestObject->getGroup(); + $this->assertProtobufEquals($group, $actualValue); $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function listGroupsExceptionTest() + public function createGroupExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->projectName('[PROJECT]'); - + $name = 'name3373707'; + $group = new Group(); try { - $client->listGroups($formattedName); + $client->createGroup($name, $group); // If the $client method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); } - // Call popReceivedCalls to ensure the stub is exhausted $transport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); @@ -154,79 +150,59 @@ public function listGroupsExceptionTest() /** * @test */ - public function getGroupTest() + public function deleteGroupTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $parentName = 'parentName1015022848'; - $filter = 'filter-1274492040'; - $isCluster = false; - $expectedResponse = new Group(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setParentName($parentName); - $expectedResponse->setFilter($filter); - $expectedResponse->setIsCluster($isCluster); + $expectedResponse = new GPBEmpty(); $transport->addResponse($expectedResponse); - // Mock request $formattedName = $client->groupName('[PROJECT]', '[GROUP]'); - - $response = $client->getGroup($formattedName); - $this->assertEquals($expectedResponse, $response); + $client->deleteGroup($formattedName); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.GroupService/GetGroup', $actualFuncCall); - + $this->assertSame('/google.monitoring.v3.GroupService/DeleteGroup', $actualFuncCall); $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function getGroupExceptionTest() + public function deleteGroupExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request $formattedName = $client->groupName('[PROJECT]', '[GROUP]'); - try { - $client->getGroup($formattedName); + $client->deleteGroup($formattedName); // If the $client method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); } - // Call popReceivedCalls to ensure the stub is exhausted $transport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); @@ -235,13 +211,13 @@ public function getGroupExceptionTest() /** * @test */ - public function createGroupTest() + public function getGroupTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response $name2 = 'name2-1052831874'; $displayName = 'displayName1615086568'; @@ -255,64 +231,50 @@ public function createGroupTest() $expectedResponse->setFilter($filter); $expectedResponse->setIsCluster($isCluster); $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->projectName('[PROJECT]'); - $group = new Group(); - - $response = $client->createGroup($formattedName, $group); + $formattedName = $client->groupName('[PROJECT]', '[GROUP]'); + $response = $client->getGroup($formattedName); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.GroupService/CreateGroup', $actualFuncCall); - + $this->assertSame('/google.monitoring.v3.GroupService/GetGroup', $actualFuncCall); $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getGroup(); - - $this->assertProtobufEquals($group, $actualValue); - $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function createGroupExceptionTest() + public function getGroupExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->projectName('[PROJECT]'); - $group = new Group(); - + $formattedName = $client->groupName('[PROJECT]', '[GROUP]'); try { - $client->createGroup($formattedName, $group); + $client->getGroup($formattedName); // If the $client method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); } - // Call popReceivedCalls to ensure the stub is exhausted $transport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); @@ -321,79 +283,72 @@ public function createGroupExceptionTest() /** * @test */ - public function updateGroupTest() + public function listGroupMembersTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $parentName = 'parentName1015022848'; - $filter = 'filter-1274492040'; - $isCluster = false; - $expectedResponse = new Group(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setParentName($parentName); - $expectedResponse->setFilter($filter); - $expectedResponse->setIsCluster($isCluster); + $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 - $group = new Group(); - - $response = $client->updateGroup($group); - $this->assertEquals($expectedResponse, $response); + $formattedName = $client->groupName('[PROJECT]', '[GROUP]'); + $response = $client->listGroupMembers($formattedName); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getMembers()[0], $resources[0]); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.GroupService/UpdateGroup', $actualFuncCall); - - $actualValue = $actualRequestObject->getGroup(); - - $this->assertProtobufEquals($group, $actualValue); - + $this->assertSame('/google.monitoring.v3.GroupService/ListGroupMembers', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function updateGroupExceptionTest() + public function listGroupMembersExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], + $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(); - + $formattedName = $client->groupName('[PROJECT]', '[GROUP]'); try { - $client->updateGroup($group); + $client->listGroupMembers($formattedName); // If the $client method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); } - // Call popReceivedCalls to ensure the stub is exhausted $transport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); @@ -402,68 +357,70 @@ public function updateGroupExceptionTest() /** * @test */ - public function deleteGroupTest() + public function listGroupsTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); + $nextPageToken = ''; + $groupElement = new Group(); + $group = [ + $groupElement, + ]; + $expectedResponse = new ListGroupsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setGroup($group); $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->groupName('[PROJECT]', '[GROUP]'); - - $client->deleteGroup($formattedName); + $name = 'name3373707'; + $response = $client->listGroups($name); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getGroup()[0], $resources[0]); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.GroupService/DeleteGroup', $actualFuncCall); - + $this->assertSame('/google.monitoring.v3.GroupService/ListGroups', $actualFuncCall); $actualValue = $actualRequestObject->getName(); - - $this->assertProtobufEquals($formattedName, $actualValue); - + $this->assertProtobufEquals($name, $actualValue); $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function deleteGroupExceptionTest() + public function listGroupsExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->groupName('[PROJECT]', '[GROUP]'); - + $name = 'name3373707'; try { - $client->deleteGroup($formattedName); + $client->listGroups($name); // If the $client method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); } - // Call popReceivedCalls to ensure the stub is exhausted $transport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); @@ -472,79 +429,70 @@ public function deleteGroupExceptionTest() /** * @test */ - public function listGroupMembersTest() + public function updateGroupTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $totalSize = 705419236; - $membersElement = new MonitoredResource(); - $members = [$membersElement]; - $expectedResponse = new ListGroupMembersResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setTotalSize($totalSize); - $expectedResponse->setMembers($members); + $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 - $formattedName = $client->groupName('[PROJECT]', '[GROUP]'); - - $response = $client->listGroupMembers($formattedName); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getMembers()[0], $resources[0]); - + $group = new Group(); + $response = $client->updateGroup($group); + $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.GroupService/ListGroupMembers', $actualFuncCall); - - $actualValue = $actualRequestObject->getName(); - - $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertSame('/google.monitoring.v3.GroupService/UpdateGroup', $actualFuncCall); + $actualValue = $actualRequestObject->getGroup(); + $this->assertProtobufEquals($group, $actualValue); $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function listGroupMembersExceptionTest() + public function updateGroupExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->groupName('[PROJECT]', '[GROUP]'); - + $group = new Group(); try { - $client->listGroupMembers($formattedName); + $client->updateGroup($group); // If the $client method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); } - // Call popReceivedCalls to ensure the stub is exhausted $transport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); diff --git a/Monitoring/tests/Unit/V3/MetricServiceClientTest.php b/Monitoring/tests/Unit/V3/MetricServiceClientTest.php index 84bb6ff0ce3..a4735f08b38 100644 --- a/Monitoring/tests/Unit/V3/MetricServiceClientTest.php +++ b/Monitoring/tests/Unit/V3/MetricServiceClientTest.php @@ -22,26 +22,28 @@ namespace Google\Cloud\Monitoring\Tests\Unit\V3; -use Google\Cloud\Monitoring\V3\MetricServiceClient; +use Google\Api\MetricDescriptor; + +use Google\Api\MonitoredResourceDescriptor; use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; + use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; -use Google\Api\MetricDescriptor; -use Google\Api\MonitoredResourceDescriptor; use Google\Cloud\Monitoring\V3\ListMetricDescriptorsResponse; use Google\Cloud\Monitoring\V3\ListMonitoredResourceDescriptorsResponse; use Google\Cloud\Monitoring\V3\ListTimeSeriesRequest\TimeSeriesView; use Google\Cloud\Monitoring\V3\ListTimeSeriesResponse; +use Google\Cloud\Monitoring\V3\MetricServiceClient; use Google\Cloud\Monitoring\V3\TimeInterval; use Google\Cloud\Monitoring\V3\TimeSeries; -use Google\Protobuf\Any; use Google\Protobuf\GPBEmpty; use Google\Rpc\Code; use stdClass; /** * @group monitoring + * * @group gapic */ class MetricServiceClientTest extends GeneratedTest @@ -59,9 +61,7 @@ private function createTransport($deserialize = null) */ private function createCredentials() { - return $this->getMockBuilder(CredentialsWrapper::class) - ->disableOriginalConstructor() - ->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); } /** @@ -72,84 +72,145 @@ private function createClient(array $options = []) $options += [ 'credentials' => $this->createCredentials(), ]; - return new MetricServiceClient($options); } /** * @test */ - public function listMonitoredResourceDescriptorsTest() + public function createMetricDescriptorTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $type = 'type3575610'; + $unit = 'unit3594628'; + $description = 'description-1724546052'; + $displayName = 'displayName1615086568'; + $expectedResponse = new MetricDescriptor(); + $expectedResponse->setName($name2); + $expectedResponse->setType($type); + $expectedResponse->setUnit($unit); + $expectedResponse->setDescription($description); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $name = 'name3373707'; + $metricDescriptor = new MetricDescriptor(); + $response = $client->createMetricDescriptor($name, $metricDescriptor); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.monitoring.v3.MetricService/CreateMetricDescriptor', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $actualValue = $actualRequestObject->getMetricDescriptor(); + $this->assertProtobufEquals($metricDescriptor, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + /** + * @test + */ + public function createMetricDescriptorExceptionTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $name = 'name3373707'; + $metricDescriptor = new MetricDescriptor(); + try { + $client->createMetricDescriptor($name, $metricDescriptor); + // If the $client method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** + * @test + */ + public function createServiceTimeSeriesTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); // Mock response - $nextPageToken = ''; - $resourceDescriptorsElement = new MonitoredResourceDescriptor(); - $resourceDescriptors = [$resourceDescriptorsElement]; - $expectedResponse = new ListMonitoredResourceDescriptorsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setResourceDescriptors($resourceDescriptors); + $expectedResponse = new GPBEmpty(); $transport->addResponse($expectedResponse); - // Mock request $formattedName = $client->projectName('[PROJECT]'); - - $response = $client->listMonitoredResourceDescriptors($formattedName); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getResourceDescriptors()[0], $resources[0]); - + $timeSeries = []; + $client->createServiceTimeSeries($formattedName, $timeSeries); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.MetricService/ListMonitoredResourceDescriptors', $actualFuncCall); - + $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 listMonitoredResourceDescriptorsExceptionTest() + public function createServiceTimeSeriesExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request $formattedName = $client->projectName('[PROJECT]'); - + $timeSeries = []; try { - $client->listMonitoredResourceDescriptors($formattedName); + $client->createServiceTimeSeries($formattedName, $timeSeries); // If the $client method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); } - // Call popReceivedCalls to ensure the stub is exhausted $transport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); @@ -158,77 +219,63 @@ public function listMonitoredResourceDescriptorsExceptionTest() /** * @test */ - public function getMonitoredResourceDescriptorTest() + public function createTimeSeriesTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $type = 'type3575610'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $expectedResponse = new MonitoredResourceDescriptor(); - $expectedResponse->setName($name2); - $expectedResponse->setType($type); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); + $expectedResponse = new GPBEmpty(); $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->monitoredResourceDescriptorName('[PROJECT]', '[MONITORED_RESOURCE_DESCRIPTOR]'); - - $response = $client->getMonitoredResourceDescriptor($formattedName); - $this->assertEquals($expectedResponse, $response); + $formattedName = $client->projectName('[PROJECT]'); + $timeSeries = []; + $client->createTimeSeries($formattedName, $timeSeries); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.MetricService/GetMonitoredResourceDescriptor', $actualFuncCall); - + $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 getMonitoredResourceDescriptorExceptionTest() + public function createTimeSeriesExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->monitoredResourceDescriptorName('[PROJECT]', '[MONITORED_RESOURCE_DESCRIPTOR]'); - + $formattedName = $client->projectName('[PROJECT]'); + $timeSeries = []; try { - $client->getMonitoredResourceDescriptor($formattedName); + $client->createTimeSeries($formattedName, $timeSeries); // If the $client method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); } - // Call popReceivedCalls to ensure the stub is exhausted $transport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); @@ -237,39 +284,25 @@ public function getMonitoredResourceDescriptorExceptionTest() /** * @test */ - public function listMetricDescriptorsTest() + public function deleteMetricDescriptorTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $metricDescriptorsElement = new MetricDescriptor(); - $metricDescriptors = [$metricDescriptorsElement]; - $expectedResponse = new ListMetricDescriptorsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setMetricDescriptors($metricDescriptors); + $expectedResponse = new GPBEmpty(); $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->projectName('[PROJECT]'); - - $response = $client->listMetricDescriptors($formattedName); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getMetricDescriptors()[0], $resources[0]); - + $formattedName = $client->metricDescriptorName('[PROJECT]', '[METRIC_DESCRIPTOR]'); + $client->deleteMetricDescriptor($formattedName); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.MetricService/ListMetricDescriptors', $actualFuncCall); - + $this->assertSame('/google.monitoring.v3.MetricService/DeleteMetricDescriptor', $actualFuncCall); $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); $this->assertTrue($transport->isExhausted()); } @@ -277,37 +310,33 @@ public function listMetricDescriptorsTest() /** * @test */ - public function listMetricDescriptorsExceptionTest() + public function deleteMetricDescriptorExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->projectName('[PROJECT]'); - + $formattedName = $client->metricDescriptorName('[PROJECT]', '[METRIC_DESCRIPTOR]'); try { - $client->listMetricDescriptors($formattedName); + $client->deleteMetricDescriptor($formattedName); // If the $client method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); } - // Call popReceivedCalls to ensure the stub is exhausted $transport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); @@ -319,10 +348,10 @@ public function listMetricDescriptorsExceptionTest() public function getMetricDescriptorTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response $name2 = 'name2-1052831874'; $type = 'type3575610'; @@ -336,10 +365,8 @@ public function getMetricDescriptorTest() $expectedResponse->setDescription($description); $expectedResponse->setDisplayName($displayName); $transport->addResponse($expectedResponse); - // Mock request $formattedName = $client->metricDescriptorName('[PROJECT]', '[METRIC_DESCRIPTOR]'); - $response = $client->getMetricDescriptor($formattedName); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -347,11 +374,8 @@ public function getMetricDescriptorTest() $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()); } @@ -361,25 +385,22 @@ public function getMetricDescriptorTest() public function getMetricDescriptorExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request $formattedName = $client->metricDescriptorName('[PROJECT]', '[METRIC_DESCRIPTOR]'); - try { $client->getMetricDescriptor($formattedName); // If the $client method call did not throw, fail the test @@ -388,7 +409,6 @@ public function getMetricDescriptorExceptionTest() $this->assertEquals($status->code, $ex->getCode()); $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); } - // Call popReceivedCalls to ensure the stub is exhausted $transport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); @@ -397,84 +417,68 @@ public function getMetricDescriptorExceptionTest() /** * @test */ - public function createMetricDescriptorTest() + public function getMonitoredResourceDescriptorTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response $name2 = 'name2-1052831874'; $type = 'type3575610'; - $unit = 'unit3594628'; - $description = 'description-1724546052'; $displayName = 'displayName1615086568'; - $expectedResponse = new MetricDescriptor(); + $description = 'description-1724546052'; + $expectedResponse = new MonitoredResourceDescriptor(); $expectedResponse->setName($name2); $expectedResponse->setType($type); - $expectedResponse->setUnit($unit); - $expectedResponse->setDescription($description); $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->projectName('[PROJECT]'); - $metricDescriptor = new MetricDescriptor(); - - $response = $client->createMetricDescriptor($formattedName, $metricDescriptor); + $formattedName = $client->monitoredResourceDescriptorName('[PROJECT]', '[MONITORED_RESOURCE_DESCRIPTOR]'); + $response = $client->getMonitoredResourceDescriptor($formattedName); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.MetricService/CreateMetricDescriptor', $actualFuncCall); - + $this->assertSame('/google.monitoring.v3.MetricService/GetMonitoredResourceDescriptor', $actualFuncCall); $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getMetricDescriptor(); - - $this->assertProtobufEquals($metricDescriptor, $actualValue); - $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function createMetricDescriptorExceptionTest() + public function getMonitoredResourceDescriptorExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->projectName('[PROJECT]'); - $metricDescriptor = new MetricDescriptor(); - + $formattedName = $client->monitoredResourceDescriptorName('[PROJECT]', '[MONITORED_RESOURCE_DESCRIPTOR]'); try { - $client->createMetricDescriptor($formattedName, $metricDescriptor); + $client->getMonitoredResourceDescriptor($formattedName); // If the $client method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); } - // Call popReceivedCalls to ensure the stub is exhausted $transport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); @@ -483,68 +487,70 @@ public function createMetricDescriptorExceptionTest() /** * @test */ - public function deleteMetricDescriptorTest() + public function listMetricDescriptorsTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); + $nextPageToken = ''; + $metricDescriptorsElement = new MetricDescriptor(); + $metricDescriptors = [ + $metricDescriptorsElement, + ]; + $expectedResponse = new ListMetricDescriptorsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setMetricDescriptors($metricDescriptors); $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->metricDescriptorName('[PROJECT]', '[METRIC_DESCRIPTOR]'); - - $client->deleteMetricDescriptor($formattedName); + $name = 'name3373707'; + $response = $client->listMetricDescriptors($name); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getMetricDescriptors()[0], $resources[0]); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.MetricService/DeleteMetricDescriptor', $actualFuncCall); - + $this->assertSame('/google.monitoring.v3.MetricService/ListMetricDescriptors', $actualFuncCall); $actualValue = $actualRequestObject->getName(); - - $this->assertProtobufEquals($formattedName, $actualValue); - + $this->assertProtobufEquals($name, $actualValue); $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function deleteMetricDescriptorExceptionTest() + public function listMetricDescriptorsExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->metricDescriptorName('[PROJECT]', '[METRIC_DESCRIPTOR]'); - + $name = 'name3373707'; try { - $client->deleteMetricDescriptor($formattedName); + $client->listMetricDescriptors($name); // If the $client method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); } - // Call popReceivedCalls to ensure the stub is exhausted $transport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); @@ -553,92 +559,70 @@ public function deleteMetricDescriptorExceptionTest() /** * @test */ - public function listTimeSeriesTest() + public function listMonitoredResourceDescriptorsTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response $nextPageToken = ''; - $timeSeriesElement = new TimeSeries(); - $timeSeries = [$timeSeriesElement]; - $expectedResponse = new ListTimeSeriesResponse(); + $resourceDescriptorsElement = new MonitoredResourceDescriptor(); + $resourceDescriptors = [ + $resourceDescriptorsElement, + ]; + $expectedResponse = new ListMonitoredResourceDescriptorsResponse(); $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setTimeSeries($timeSeries); + $expectedResponse->setResourceDescriptors($resourceDescriptors); $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->projectName('[PROJECT]'); - $filter = 'filter-1274492040'; - $interval = new TimeInterval(); - $view = TimeSeriesView::FULL; - - $response = $client->listTimeSeries($formattedName, $filter, $interval, $view); + $name = 'name3373707'; + $response = $client->listMonitoredResourceDescriptors($name); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getTimeSeries()[0], $resources[0]); - + $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/ListTimeSeries', $actualFuncCall); - + $this->assertSame('/google.monitoring.v3.MetricService/ListMonitoredResourceDescriptors', $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->assertProtobufEquals($name, $actualValue); $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function listTimeSeriesExceptionTest() + public function listMonitoredResourceDescriptorsExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->projectName('[PROJECT]'); - $filter = 'filter-1274492040'; - $interval = new TimeInterval(); - $view = TimeSeriesView::FULL; - + $name = 'name3373707'; try { - $client->listTimeSeries($formattedName, $filter, $interval, $view); + $client->listMonitoredResourceDescriptors($name); // If the $client method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); } - // Call popReceivedCalls to ensure the stub is exhausted $transport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); @@ -647,73 +631,84 @@ public function listTimeSeriesExceptionTest() /** * @test */ - public function createTimeSeriesTest() + public function listTimeSeriesTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); + $nextPageToken = ''; + $unit = 'unit3594628'; + $timeSeriesElement = new TimeSeries(); + $timeSeries = [ + $timeSeriesElement, + ]; + $expectedResponse = new ListTimeSeriesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setUnit($unit); + $expectedResponse->setTimeSeries($timeSeries); $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->projectName('[PROJECT]'); - $timeSeries = []; - - $client->createTimeSeries($formattedName, $timeSeries); + $formattedName = $client->workspaceName('[PROJECT]'); + $filter = 'filter-1274492040'; + $interval = new TimeInterval(); + $view = TimeSeriesView::FULL; + $response = $client->listTimeSeries($formattedName, $filter, $interval, $view); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getTimeSeries()[0], $resources[0]); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.MetricService/CreateTimeSeries', $actualFuncCall); - + $this->assertSame('/google.monitoring.v3.MetricService/ListTimeSeries', $actualFuncCall); $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getTimeSeries(); - - $this->assertProtobufEquals($timeSeries, $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 createTimeSeriesExceptionTest() + public function listTimeSeriesExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->projectName('[PROJECT]'); - $timeSeries = []; - + $formattedName = $client->workspaceName('[PROJECT]'); + $filter = 'filter-1274492040'; + $interval = new TimeInterval(); + $view = TimeSeriesView::FULL; try { - $client->createTimeSeries($formattedName, $timeSeries); + $client->listTimeSeries($formattedName, $filter, $interval, $view); // If the $client method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); } - // Call popReceivedCalls to ensure the stub is exhausted $transport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); diff --git a/Monitoring/tests/Unit/V3/NotificationChannelServiceClientTest.php b/Monitoring/tests/Unit/V3/NotificationChannelServiceClientTest.php index 84c67a07bc9..d1b56e01aef 100644 --- a/Monitoring/tests/Unit/V3/NotificationChannelServiceClientTest.php +++ b/Monitoring/tests/Unit/V3/NotificationChannelServiceClientTest.php @@ -22,23 +22,25 @@ namespace Google\Cloud\Monitoring\Tests\Unit\V3; -use Google\Cloud\Monitoring\V3\NotificationChannelServiceClient; use Google\ApiCore\ApiException; + use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; + use Google\Cloud\Monitoring\V3\GetNotificationChannelVerificationCodeResponse; use Google\Cloud\Monitoring\V3\ListNotificationChannelDescriptorsResponse; use Google\Cloud\Monitoring\V3\ListNotificationChannelsResponse; use Google\Cloud\Monitoring\V3\NotificationChannel; use Google\Cloud\Monitoring\V3\NotificationChannelDescriptor; -use Google\Protobuf\Any; +use Google\Cloud\Monitoring\V3\NotificationChannelServiceClient; use Google\Protobuf\GPBEmpty; use Google\Rpc\Code; use stdClass; /** * @group monitoring + * * @group gapic */ class NotificationChannelServiceClientTest extends GeneratedTest @@ -56,9 +58,7 @@ private function createTransport($deserialize = null) */ private function createCredentials() { - return $this->getMockBuilder(CredentialsWrapper::class) - ->disableOriginalConstructor() - ->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); } /** @@ -69,84 +69,78 @@ private function createClient(array $options = []) $options += [ 'credentials' => $this->createCredentials(), ]; - return new NotificationChannelServiceClient($options); } /** * @test */ - public function listNotificationChannelDescriptorsTest() + public function createNotificationChannelTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $channelDescriptorsElement = new NotificationChannelDescriptor(); - $channelDescriptors = [$channelDescriptorsElement]; - $expectedResponse = new ListNotificationChannelDescriptorsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setChannelDescriptors($channelDescriptors); + $type = 'type3575610'; + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $expectedResponse = new NotificationChannel(); + $expectedResponse->setType($type); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->projectName('[PROJECT]'); - - $response = $client->listNotificationChannelDescriptors($formattedName); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getChannelDescriptors()[0], $resources[0]); - + $name = 'name3373707'; + $notificationChannel = new NotificationChannel(); + $response = $client->createNotificationChannel($name, $notificationChannel); + $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.NotificationChannelService/ListNotificationChannelDescriptors', $actualFuncCall); - + $this->assertSame('/google.monitoring.v3.NotificationChannelService/CreateNotificationChannel', $actualFuncCall); $actualValue = $actualRequestObject->getName(); - - $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertProtobufEquals($name, $actualValue); + $actualValue = $actualRequestObject->getNotificationChannel(); + $this->assertProtobufEquals($notificationChannel, $actualValue); $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function listNotificationChannelDescriptorsExceptionTest() + public function createNotificationChannelExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->projectName('[PROJECT]'); - + $name = 'name3373707'; + $notificationChannel = new NotificationChannel(); try { - $client->listNotificationChannelDescriptors($formattedName); + $client->createNotificationChannel($name, $notificationChannel); // If the $client method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); } - // Call popReceivedCalls to ensure the stub is exhausted $transport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); @@ -155,77 +149,59 @@ public function listNotificationChannelDescriptorsExceptionTest() /** * @test */ - public function getNotificationChannelDescriptorTest() + public function deleteNotificationChannelTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $type = 'type3575610'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $expectedResponse = new NotificationChannelDescriptor(); - $expectedResponse->setName($name2); - $expectedResponse->setType($type); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); + $expectedResponse = new GPBEmpty(); $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->notificationChannelDescriptorName('[PROJECT]', '[CHANNEL_DESCRIPTOR]'); - - $response = $client->getNotificationChannelDescriptor($formattedName); - $this->assertEquals($expectedResponse, $response); + $formattedName = $client->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + $client->deleteNotificationChannel($formattedName); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.NotificationChannelService/GetNotificationChannelDescriptor', $actualFuncCall); - + $this->assertSame('/google.monitoring.v3.NotificationChannelService/DeleteNotificationChannel', $actualFuncCall); $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function getNotificationChannelDescriptorExceptionTest() + public function deleteNotificationChannelExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->notificationChannelDescriptorName('[PROJECT]', '[CHANNEL_DESCRIPTOR]'); - + $formattedName = $client->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); try { - $client->getNotificationChannelDescriptor($formattedName); + $client->deleteNotificationChannel($formattedName); // If the $client method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); } - // Call popReceivedCalls to ensure the stub is exhausted $transport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); @@ -234,39 +210,34 @@ public function getNotificationChannelDescriptorExceptionTest() /** * @test */ - public function listNotificationChannelsTest() + public function getNotificationChannelTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $notificationChannelsElement = new NotificationChannel(); - $notificationChannels = [$notificationChannelsElement]; - $expectedResponse = new ListNotificationChannelsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setNotificationChannels($notificationChannels); + $type = 'type3575610'; + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $expectedResponse = new NotificationChannel(); + $expectedResponse->setType($type); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->projectName('[PROJECT]'); - - $response = $client->listNotificationChannels($formattedName); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getNotificationChannels()[0], $resources[0]); - + $formattedName = $client->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + $response = $client->getNotificationChannel($formattedName); + $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.NotificationChannelService/ListNotificationChannels', $actualFuncCall); - + $this->assertSame('/google.monitoring.v3.NotificationChannelService/GetNotificationChannel', $actualFuncCall); $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); $this->assertTrue($transport->isExhausted()); } @@ -274,37 +245,33 @@ public function listNotificationChannelsTest() /** * @test */ - public function listNotificationChannelsExceptionTest() + public function getNotificationChannelExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->projectName('[PROJECT]'); - + $formattedName = $client->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); try { - $client->listNotificationChannels($formattedName); + $client->getNotificationChannel($formattedName); // If the $client method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); } - // Call popReceivedCalls to ensure the stub is exhausted $transport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); @@ -313,77 +280,68 @@ public function listNotificationChannelsExceptionTest() /** * @test */ - public function getNotificationChannelTest() + public function getNotificationChannelDescriptorTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $type = 'type3575610'; $name2 = 'name2-1052831874'; + $type = 'type3575610'; $displayName = 'displayName1615086568'; $description = 'description-1724546052'; - $expectedResponse = new NotificationChannel(); - $expectedResponse->setType($type); + $expectedResponse = new NotificationChannelDescriptor(); $expectedResponse->setName($name2); + $expectedResponse->setType($type); $expectedResponse->setDisplayName($displayName); $expectedResponse->setDescription($description); $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - - $response = $client->getNotificationChannel($formattedName); + $formattedName = $client->notificationChannelDescriptorName('[PROJECT]', '[CHANNEL_DESCRIPTOR]'); + $response = $client->getNotificationChannelDescriptor($formattedName); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.NotificationChannelService/GetNotificationChannel', $actualFuncCall); - + $this->assertSame('/google.monitoring.v3.NotificationChannelService/GetNotificationChannelDescriptor', $actualFuncCall); $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function getNotificationChannelExceptionTest() + public function getNotificationChannelDescriptorExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - + $formattedName = $client->notificationChannelDescriptorName('[PROJECT]', '[CHANNEL_DESCRIPTOR]'); try { - $client->getNotificationChannel($formattedName); + $client->getNotificationChannelDescriptor($formattedName); // If the $client method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); } - // Call popReceivedCalls to ensure the stub is exhausted $transport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); @@ -392,82 +350,62 @@ public function getNotificationChannelExceptionTest() /** * @test */ - public function createNotificationChannelTest() + public function getNotificationChannelVerificationCodeTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $type = 'type3575610'; - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $expectedResponse = new NotificationChannel(); - $expectedResponse->setType($type); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); + $code = 'code3059181'; + $expectedResponse = new GetNotificationChannelVerificationCodeResponse(); + $expectedResponse->setCode($code); $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->projectName('[PROJECT]'); - $notificationChannel = new NotificationChannel(); - - $response = $client->createNotificationChannel($formattedName, $notificationChannel); + $formattedName = $client->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); + $response = $client->getNotificationChannelVerificationCode($formattedName); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.NotificationChannelService/CreateNotificationChannel', $actualFuncCall); - + $this->assertSame('/google.monitoring.v3.NotificationChannelService/GetNotificationChannelVerificationCode', $actualFuncCall); $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getNotificationChannel(); - - $this->assertProtobufEquals($notificationChannel, $actualValue); - $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function createNotificationChannelExceptionTest() + public function getNotificationChannelVerificationCodeExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->projectName('[PROJECT]'); - $notificationChannel = new NotificationChannel(); - + $formattedName = $client->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); try { - $client->createNotificationChannel($formattedName, $notificationChannel); + $client->getNotificationChannelVerificationCode($formattedName); // If the $client method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); } - // Call popReceivedCalls to ensure the stub is exhausted $transport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); @@ -476,77 +414,70 @@ public function createNotificationChannelExceptionTest() /** * @test */ - public function updateNotificationChannelTest() + public function listNotificationChannelDescriptorsTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $type = 'type3575610'; - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $expectedResponse = new NotificationChannel(); - $expectedResponse->setType($type); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); + $nextPageToken = ''; + $channelDescriptorsElement = new NotificationChannelDescriptor(); + $channelDescriptors = [ + $channelDescriptorsElement, + ]; + $expectedResponse = new ListNotificationChannelDescriptorsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setChannelDescriptors($channelDescriptors); $transport->addResponse($expectedResponse); - // Mock request - $notificationChannel = new NotificationChannel(); - - $response = $client->updateNotificationChannel($notificationChannel); - $this->assertEquals($expectedResponse, $response); + $name = 'name3373707'; + $response = $client->listNotificationChannelDescriptors($name); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getChannelDescriptors()[0], $resources[0]); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.NotificationChannelService/UpdateNotificationChannel', $actualFuncCall); - - $actualValue = $actualRequestObject->getNotificationChannel(); - - $this->assertProtobufEquals($notificationChannel, $actualValue); - + $this->assertSame('/google.monitoring.v3.NotificationChannelService/ListNotificationChannelDescriptors', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function updateNotificationChannelExceptionTest() + public function listNotificationChannelDescriptorsExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], + $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(); - + $name = 'name3373707'; try { - $client->updateNotificationChannel($notificationChannel); + $client->listNotificationChannelDescriptors($name); // If the $client method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); } - // Call popReceivedCalls to ensure the stub is exhausted $transport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); @@ -555,68 +486,72 @@ public function updateNotificationChannelExceptionTest() /** * @test */ - public function deleteNotificationChannelTest() + public function listNotificationChannelsTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); + $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 - $formattedName = $client->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - - $client->deleteNotificationChannel($formattedName); + $name = 'name3373707'; + $response = $client->listNotificationChannels($name); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getNotificationChannels()[0], $resources[0]); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.NotificationChannelService/DeleteNotificationChannel', $actualFuncCall); - + $this->assertSame('/google.monitoring.v3.NotificationChannelService/ListNotificationChannels', $actualFuncCall); $actualValue = $actualRequestObject->getName(); - - $this->assertProtobufEquals($formattedName, $actualValue); - + $this->assertProtobufEquals($name, $actualValue); $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function deleteNotificationChannelExceptionTest() + public function listNotificationChannelsExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - + $name = 'name3373707'; try { - $client->deleteNotificationChannel($formattedName); + $client->listNotificationChannels($name); // If the $client method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); } - // Call popReceivedCalls to ensure the stub is exhausted $transport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); @@ -628,28 +563,23 @@ public function deleteNotificationChannelExceptionTest() public function sendNotificationChannelVerificationCodeTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response $expectedResponse = new GPBEmpty(); $transport->addResponse($expectedResponse); - // Mock request $formattedName = $client->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - $client->sendNotificationChannelVerificationCode($formattedName); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); $this->assertSame('/google.monitoring.v3.NotificationChannelService/SendNotificationChannelVerificationCode', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); } @@ -659,25 +589,22 @@ public function sendNotificationChannelVerificationCodeTest() public function sendNotificationChannelVerificationCodeExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request $formattedName = $client->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - try { $client->sendNotificationChannelVerificationCode($formattedName); // If the $client method call did not throw, fail the test @@ -686,7 +613,6 @@ public function sendNotificationChannelVerificationCodeExceptionTest() $this->assertEquals($status->code, $ex->getCode()); $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); } - // Call popReceivedCalls to ensure the stub is exhausted $transport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); @@ -695,71 +621,68 @@ public function sendNotificationChannelVerificationCodeExceptionTest() /** * @test */ - public function getNotificationChannelVerificationCodeTest() + public function updateNotificationChannelTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $code = 'code3059181'; - $expectedResponse = new GetNotificationChannelVerificationCodeResponse(); - $expectedResponse->setCode($code); + $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 - $formattedName = $client->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - - $response = $client->getNotificationChannelVerificationCode($formattedName); + $notificationChannel = new NotificationChannel(); + $response = $client->updateNotificationChannel($notificationChannel); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.NotificationChannelService/GetNotificationChannelVerificationCode', $actualFuncCall); - - $actualValue = $actualRequestObject->getName(); - - $this->assertProtobufEquals($formattedName, $actualValue); - + $this->assertSame('/google.monitoring.v3.NotificationChannelService/UpdateNotificationChannel', $actualFuncCall); + $actualValue = $actualRequestObject->getNotificationChannel(); + $this->assertProtobufEquals($notificationChannel, $actualValue); $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function getNotificationChannelVerificationCodeExceptionTest() + public function updateNotificationChannelExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - + $notificationChannel = new NotificationChannel(); try { - $client->getNotificationChannelVerificationCode($formattedName); + $client->updateNotificationChannel($notificationChannel); // If the $client method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); } - // Call popReceivedCalls to ensure the stub is exhausted $transport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); @@ -771,10 +694,10 @@ public function getNotificationChannelVerificationCodeExceptionTest() public function verifyNotificationChannelTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response $type = 'type3575610'; $name2 = 'name2-1052831874'; @@ -786,11 +709,9 @@ public function verifyNotificationChannelTest() $expectedResponse->setDisplayName($displayName); $expectedResponse->setDescription($description); $transport->addResponse($expectedResponse); - // Mock request $formattedName = $client->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); $code = 'code3059181'; - $response = $client->verifyNotificationChannel($formattedName, $code); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -798,14 +719,10 @@ public function verifyNotificationChannelTest() $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()); } @@ -815,26 +732,23 @@ public function verifyNotificationChannelTest() public function verifyNotificationChannelExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request $formattedName = $client->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); $code = 'code3059181'; - try { $client->verifyNotificationChannel($formattedName, $code); // If the $client method call did not throw, fail the test @@ -843,7 +757,6 @@ public function verifyNotificationChannelExceptionTest() $this->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/Monitoring/tests/Unit/V3/QueryServiceClientTest.php similarity index 99% rename from owl-bot-staging/Monitoring/v3/tests/Unit/V3/QueryServiceClientTest.php rename to Monitoring/tests/Unit/V3/QueryServiceClientTest.php index b0becaf179f..f57190cf676 100644 --- a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/QueryServiceClientTest.php +++ b/Monitoring/tests/Unit/V3/QueryServiceClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class) - ->disableOriginalConstructor() - ->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); } /** @@ -68,7 +68,6 @@ private function createClient(array $options = []) $options += [ 'credentials' => $this->createCredentials(), ]; - return new ServiceMonitoringServiceClient($options); } @@ -78,10 +77,10 @@ private function createClient(array $options = []) public function createServiceTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response $name = 'name3373707'; $displayName = 'displayName1615086568'; @@ -89,26 +88,20 @@ public function createServiceTest() $expectedResponse->setName($name); $expectedResponse->setDisplayName($displayName); $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $client->projectName('[PROJECT]'); + $parent = 'parent-995424086'; $service = new Service(); - - $response = $client->createService($formattedParent, $service); + $response = $client->createService($parent, $service); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); $this->assertSame('/google.monitoring.v3.ServiceMonitoringService/CreateService', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - - $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertProtobufEquals($parent, $actualValue); $actualValue = $actualRequestObject->getService(); - $this->assertProtobufEquals($service, $actualValue); - $this->assertTrue($transport->isExhausted()); } @@ -118,35 +111,31 @@ public function createServiceTest() public function createServiceExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request - $formattedParent = $client->projectName('[PROJECT]'); + $parent = 'parent-995424086'; $service = new Service(); - try { - $client->createService($formattedParent, $service); + $client->createService($parent, $service); // If the $client method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); } - // Call popReceivedCalls to ensure the stub is exhausted $transport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); @@ -155,73 +144,70 @@ public function createServiceExceptionTest() /** * @test */ - public function getServiceTest() + public function createServiceLevelObjectiveTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; + $name = 'name3373707'; $displayName = 'displayName1615086568'; - $expectedResponse = new Service(); - $expectedResponse->setName($name2); + $goal = 317825.0; + $expectedResponse = new ServiceLevelObjective(); + $expectedResponse->setName($name); $expectedResponse->setDisplayName($displayName); + $expectedResponse->setGoal($goal); $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->serviceName('[PROJECT]', '[SERVICE]'); - - $response = $client->getService($formattedName); + $formattedParent = $client->serviceName('[PROJECT]', '[SERVICE]'); + $serviceLevelObjective = new ServiceLevelObjective(); + $response = $client->createServiceLevelObjective($formattedParent, $serviceLevelObjective); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.ServiceMonitoringService/GetService', $actualFuncCall); - - $actualValue = $actualRequestObject->getName(); - - $this->assertProtobufEquals($formattedName, $actualValue); - + $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 getServiceExceptionTest() + public function createServiceLevelObjectiveExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->serviceName('[PROJECT]', '[SERVICE]'); - + $formattedParent = $client->serviceName('[PROJECT]', '[SERVICE]'); + $serviceLevelObjective = new ServiceLevelObjective(); try { - $client->getService($formattedName); + $client->createServiceLevelObjective($formattedParent, $serviceLevelObjective); // If the $client method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); } - // Call popReceivedCalls to ensure the stub is exhausted $transport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); @@ -230,77 +216,59 @@ public function getServiceExceptionTest() /** * @test */ - public function listServicesTest() + public function deleteServiceTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $servicesElement = new Service(); - $services = [$servicesElement]; - $expectedResponse = new ListServicesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setServices($services); + $expectedResponse = new GPBEmpty(); $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $client->projectName('[PROJECT]'); - - $response = $client->listServices($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getServices()[0], $resources[0]); - + $formattedName = $client->serviceName('[PROJECT]', '[SERVICE]'); + $client->deleteService($formattedName); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.ServiceMonitoringService/ListServices', $actualFuncCall); - - $actualValue = $actualRequestObject->getParent(); - - $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertSame('/google.monitoring.v3.ServiceMonitoringService/DeleteService', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function listServicesExceptionTest() + public function deleteServiceExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request - $formattedParent = $client->projectName('[PROJECT]'); - + $formattedName = $client->serviceName('[PROJECT]', '[SERVICE]'); try { - $client->listServices($formattedParent); + $client->deleteService($formattedName); // If the $client method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); } - // Call popReceivedCalls to ensure the stub is exhausted $transport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); @@ -309,73 +277,59 @@ public function listServicesExceptionTest() /** * @test */ - public function updateServiceTest() + public function deleteServiceLevelObjectiveTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Service(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); + $expectedResponse = new GPBEmpty(); $transport->addResponse($expectedResponse); - // Mock request - $service = new Service(); - - $response = $client->updateService($service); - $this->assertEquals($expectedResponse, $response); + $formattedName = $client->serviceLevelObjectiveName('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]'); + $client->deleteServiceLevelObjective($formattedName); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.ServiceMonitoringService/UpdateService', $actualFuncCall); - - $actualValue = $actualRequestObject->getService(); - - $this->assertProtobufEquals($service, $actualValue); - + $this->assertSame('/google.monitoring.v3.ServiceMonitoringService/DeleteServiceLevelObjective', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function updateServiceExceptionTest() + public function deleteServiceLevelObjectiveExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], + $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(); - + $formattedName = $client->serviceLevelObjectiveName('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]'); try { - $client->updateService($service); + $client->deleteServiceLevelObjective($formattedName); // If the $client method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); } - // Call popReceivedCalls to ensure the stub is exhausted $transport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); @@ -384,68 +338,64 @@ public function updateServiceExceptionTest() /** * @test */ - public function deleteServiceTest() + public function getServiceTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Service(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); $transport->addResponse($expectedResponse); - // Mock request $formattedName = $client->serviceName('[PROJECT]', '[SERVICE]'); - - $client->deleteService($formattedName); + $response = $client->getService($formattedName); + $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.ServiceMonitoringService/DeleteService', $actualFuncCall); - + $this->assertSame('/google.monitoring.v3.ServiceMonitoringService/GetService', $actualFuncCall); $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function deleteServiceExceptionTest() + public function getServiceExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request $formattedName = $client->serviceName('[PROJECT]', '[SERVICE]'); - try { - $client->deleteService($formattedName); + $client->getService($formattedName); // If the $client method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); } - // Call popReceivedCalls to ensure the stub is exhausted $transport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); @@ -454,80 +404,66 @@ public function deleteServiceExceptionTest() /** * @test */ - public function createServiceLevelObjectiveTest() + public function getServiceLevelObjectiveTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; + $name2 = 'name2-1052831874'; $displayName = 'displayName1615086568'; $goal = 317825.0; $expectedResponse = new ServiceLevelObjective(); - $expectedResponse->setName($name); + $expectedResponse->setName($name2); $expectedResponse->setDisplayName($displayName); $expectedResponse->setGoal($goal); $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $client->serviceName('[PROJECT]', '[SERVICE]'); - $serviceLevelObjective = new ServiceLevelObjective(); - - $response = $client->createServiceLevelObjective($formattedParent, $serviceLevelObjective); + $formattedName = $client->serviceLevelObjectiveName('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]'); + $response = $client->getServiceLevelObjective($formattedName); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.ServiceMonitoringService/CreateServiceLevelObjective', $actualFuncCall); - - $actualValue = $actualRequestObject->getParent(); - - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getServiceLevelObjective(); - - $this->assertProtobufEquals($serviceLevelObjective, $actualValue); - + $this->assertSame('/google.monitoring.v3.ServiceMonitoringService/GetServiceLevelObjective', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function createServiceLevelObjectiveExceptionTest() + public function getServiceLevelObjectiveExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request - $formattedParent = $client->serviceName('[PROJECT]', '[SERVICE]'); - $serviceLevelObjective = new ServiceLevelObjective(); - + $formattedName = $client->serviceLevelObjectiveName('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]'); try { - $client->createServiceLevelObjective($formattedParent, $serviceLevelObjective); + $client->getServiceLevelObjective($formattedName); // If the $client method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); } - // Call popReceivedCalls to ensure the stub is exhausted $transport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); @@ -536,75 +472,70 @@ public function createServiceLevelObjectiveExceptionTest() /** * @test */ - public function getServiceLevelObjectiveTest() + public function listServiceLevelObjectivesTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $goal = 317825.0; - $expectedResponse = new ServiceLevelObjective(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setGoal($goal); + $nextPageToken = ''; + $serviceLevelObjectivesElement = new ServiceLevelObjective(); + $serviceLevelObjectives = [ + $serviceLevelObjectivesElement, + ]; + $expectedResponse = new ListServiceLevelObjectivesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setServiceLevelObjectives($serviceLevelObjectives); $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->serviceLevelObjectiveName('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]'); - - $response = $client->getServiceLevelObjective($formattedName); - $this->assertEquals($expectedResponse, $response); + $formattedParent = $client->serviceName('[PROJECT]', '[SERVICE]'); + $response = $client->listServiceLevelObjectives($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getServiceLevelObjectives()[0], $resources[0]); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.ServiceMonitoringService/GetServiceLevelObjective', $actualFuncCall); - - $actualValue = $actualRequestObject->getName(); - - $this->assertProtobufEquals($formattedName, $actualValue); - + $this->assertSame('/google.monitoring.v3.ServiceMonitoringService/ListServiceLevelObjectives', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function getServiceLevelObjectiveExceptionTest() + public function listServiceLevelObjectivesExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->serviceLevelObjectiveName('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]'); - + $formattedParent = $client->serviceName('[PROJECT]', '[SERVICE]'); try { - $client->getServiceLevelObjective($formattedName); + $client->listServiceLevelObjectives($formattedParent); // If the $client method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); } - // Call popReceivedCalls to ensure the stub is exhausted $transport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); @@ -613,77 +544,70 @@ public function getServiceLevelObjectiveExceptionTest() /** * @test */ - public function listServiceLevelObjectivesTest() + public function listServicesTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response $nextPageToken = ''; - $serviceLevelObjectivesElement = new ServiceLevelObjective(); - $serviceLevelObjectives = [$serviceLevelObjectivesElement]; - $expectedResponse = new ListServiceLevelObjectivesResponse(); + $servicesElement = new Service(); + $services = [ + $servicesElement, + ]; + $expectedResponse = new ListServicesResponse(); $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setServiceLevelObjectives($serviceLevelObjectives); + $expectedResponse->setServices($services); $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $client->serviceName('[PROJECT]', '[SERVICE]'); - - $response = $client->listServiceLevelObjectives($formattedParent); + $parent = 'parent-995424086'; + $response = $client->listServices($parent); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getServiceLevelObjectives()[0], $resources[0]); - + $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/ListServiceLevelObjectives', $actualFuncCall); - + $this->assertSame('/google.monitoring.v3.ServiceMonitoringService/ListServices', $actualFuncCall); $actualValue = $actualRequestObject->getParent(); - - $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertProtobufEquals($parent, $actualValue); $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function listServiceLevelObjectivesExceptionTest() + public function listServicesExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request - $formattedParent = $client->serviceName('[PROJECT]', '[SERVICE]'); - + $parent = 'parent-995424086'; try { - $client->listServiceLevelObjectives($formattedParent); + $client->listServices($parent); // If the $client method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); } - // Call popReceivedCalls to ensure the stub is exhausted $transport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); @@ -692,75 +616,64 @@ public function listServiceLevelObjectivesExceptionTest() /** * @test */ - public function updateServiceLevelObjectiveTest() + public function updateServiceTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response $name = 'name3373707'; $displayName = 'displayName1615086568'; - $goal = 317825.0; - $expectedResponse = new ServiceLevelObjective(); + $expectedResponse = new Service(); $expectedResponse->setName($name); $expectedResponse->setDisplayName($displayName); - $expectedResponse->setGoal($goal); $transport->addResponse($expectedResponse); - // Mock request - $serviceLevelObjective = new ServiceLevelObjective(); - - $response = $client->updateServiceLevelObjective($serviceLevelObjective); + $service = new Service(); + $response = $client->updateService($service); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.ServiceMonitoringService/UpdateServiceLevelObjective', $actualFuncCall); - - $actualValue = $actualRequestObject->getServiceLevelObjective(); - - $this->assertProtobufEquals($serviceLevelObjective, $actualValue); - + $this->assertSame('/google.monitoring.v3.ServiceMonitoringService/UpdateService', $actualFuncCall); + $actualValue = $actualRequestObject->getService(); + $this->assertProtobufEquals($service, $actualValue); $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function updateServiceLevelObjectiveExceptionTest() + public function updateServiceExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], + $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(); - + $service = new Service(); try { - $client->updateServiceLevelObjective($serviceLevelObjective); + $client->updateService($service); // If the $client method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); } - // Call popReceivedCalls to ensure the stub is exhausted $transport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); @@ -769,68 +682,66 @@ public function updateServiceLevelObjectiveExceptionTest() /** * @test */ - public function deleteServiceLevelObjectiveTest() + public function updateServiceLevelObjectiveTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $goal = 317825.0; + $expectedResponse = new ServiceLevelObjective(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setGoal($goal); $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->serviceLevelObjectiveName('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]'); - - $client->deleteServiceLevelObjective($formattedName); + $serviceLevelObjective = new ServiceLevelObjective(); + $response = $client->updateServiceLevelObjective($serviceLevelObjective); + $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.ServiceMonitoringService/DeleteServiceLevelObjective', $actualFuncCall); - - $actualValue = $actualRequestObject->getName(); - - $this->assertProtobufEquals($formattedName, $actualValue); - + $this->assertSame('/google.monitoring.v3.ServiceMonitoringService/UpdateServiceLevelObjective', $actualFuncCall); + $actualValue = $actualRequestObject->getServiceLevelObjective(); + $this->assertProtobufEquals($serviceLevelObjective, $actualValue); $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function deleteServiceLevelObjectiveExceptionTest() + public function updateServiceLevelObjectiveExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->serviceLevelObjectiveName('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]'); - + $serviceLevelObjective = new ServiceLevelObjective(); try { - $client->deleteServiceLevelObjective($formattedName); + $client->updateServiceLevelObjective($serviceLevelObjective); // If the $client method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); } - // Call popReceivedCalls to ensure the stub is exhausted $transport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); diff --git a/Monitoring/tests/Unit/V3/UptimeCheckServiceClientTest.php b/Monitoring/tests/Unit/V3/UptimeCheckServiceClientTest.php index 201a782c673..07013066051 100644 --- a/Monitoring/tests/Unit/V3/UptimeCheckServiceClientTest.php +++ b/Monitoring/tests/Unit/V3/UptimeCheckServiceClientTest.php @@ -22,22 +22,24 @@ namespace Google\Cloud\Monitoring\Tests\Unit\V3; -use Google\Cloud\Monitoring\V3\UptimeCheckServiceClient; use Google\ApiCore\ApiException; + use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; + use Google\Cloud\Monitoring\V3\ListUptimeCheckConfigsResponse; use Google\Cloud\Monitoring\V3\ListUptimeCheckIpsResponse; use Google\Cloud\Monitoring\V3\UptimeCheckConfig; use Google\Cloud\Monitoring\V3\UptimeCheckIp; -use Google\Protobuf\Any; +use Google\Cloud\Monitoring\V3\UptimeCheckServiceClient; use Google\Protobuf\GPBEmpty; use Google\Rpc\Code; use stdClass; /** * @group monitoring + * * @group gapic */ class UptimeCheckServiceClientTest extends GeneratedTest @@ -55,9 +57,7 @@ private function createTransport($deserialize = null) */ private function createCredentials() { - return $this->getMockBuilder(CredentialsWrapper::class) - ->disableOriginalConstructor() - ->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); } /** @@ -68,86 +68,76 @@ private function createClient(array $options = []) $options += [ 'credentials' => $this->createCredentials(), ]; - return new UptimeCheckServiceClient($options); } /** * @test */ - public function listUptimeCheckConfigsTest() + public function createUptimeCheckConfigTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $totalSize = 705419236; - $uptimeCheckConfigsElement = new UptimeCheckConfig(); - $uptimeCheckConfigs = [$uptimeCheckConfigsElement]; - $expectedResponse = new ListUptimeCheckConfigsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setTotalSize($totalSize); - $expectedResponse->setUptimeCheckConfigs($uptimeCheckConfigs); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $isInternal = true; + $expectedResponse = new UptimeCheckConfig(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setIsInternal($isInternal); $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $client->projectName('[PROJECT]'); - - $response = $client->listUptimeCheckConfigs($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getUptimeCheckConfigs()[0], $resources[0]); - + $parent = 'parent-995424086'; + $uptimeCheckConfig = new UptimeCheckConfig(); + $response = $client->createUptimeCheckConfig($parent, $uptimeCheckConfig); + $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.UptimeCheckService/ListUptimeCheckConfigs', $actualFuncCall); - + $this->assertSame('/google.monitoring.v3.UptimeCheckService/CreateUptimeCheckConfig', $actualFuncCall); $actualValue = $actualRequestObject->getParent(); - - $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertProtobufEquals($parent, $actualValue); + $actualValue = $actualRequestObject->getUptimeCheckConfig(); + $this->assertProtobufEquals($uptimeCheckConfig, $actualValue); $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function listUptimeCheckConfigsExceptionTest() + public function createUptimeCheckConfigExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request - $formattedParent = $client->projectName('[PROJECT]'); - + $parent = 'parent-995424086'; + $uptimeCheckConfig = new UptimeCheckConfig(); try { - $client->listUptimeCheckConfigs($formattedParent); + $client->createUptimeCheckConfig($parent, $uptimeCheckConfig); // If the $client method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); } - // Call popReceivedCalls to ensure the stub is exhausted $transport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); @@ -156,75 +146,59 @@ public function listUptimeCheckConfigsExceptionTest() /** * @test */ - public function getUptimeCheckConfigTest() + public function deleteUptimeCheckConfigTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $isInternal = true; - $expectedResponse = new UptimeCheckConfig(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setIsInternal($isInternal); + $expectedResponse = new GPBEmpty(); $transport->addResponse($expectedResponse); - // Mock request $formattedName = $client->uptimeCheckConfigName('[PROJECT]', '[UPTIME_CHECK_CONFIG]'); - - $response = $client->getUptimeCheckConfig($formattedName); - $this->assertEquals($expectedResponse, $response); + $client->deleteUptimeCheckConfig($formattedName); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.UptimeCheckService/GetUptimeCheckConfig', $actualFuncCall); - + $this->assertSame('/google.monitoring.v3.UptimeCheckService/DeleteUptimeCheckConfig', $actualFuncCall); $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function getUptimeCheckConfigExceptionTest() + public function deleteUptimeCheckConfigExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request $formattedName = $client->uptimeCheckConfigName('[PROJECT]', '[UPTIME_CHECK_CONFIG]'); - try { - $client->getUptimeCheckConfig($formattedName); + $client->deleteUptimeCheckConfig($formattedName); // If the $client method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); } - // Call popReceivedCalls to ensure the stub is exhausted $transport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); @@ -233,80 +207,66 @@ public function getUptimeCheckConfigExceptionTest() /** * @test */ - public function createUptimeCheckConfigTest() + public function getUptimeCheckConfigTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; + $name2 = 'name2-1052831874'; $displayName = 'displayName1615086568'; $isInternal = true; $expectedResponse = new UptimeCheckConfig(); - $expectedResponse->setName($name); + $expectedResponse->setName($name2); $expectedResponse->setDisplayName($displayName); $expectedResponse->setIsInternal($isInternal); $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $client->projectName('[PROJECT]'); - $uptimeCheckConfig = new UptimeCheckConfig(); - - $response = $client->createUptimeCheckConfig($formattedParent, $uptimeCheckConfig); + $formattedName = $client->uptimeCheckConfigName('[PROJECT]', '[UPTIME_CHECK_CONFIG]'); + $response = $client->getUptimeCheckConfig($formattedName); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.UptimeCheckService/CreateUptimeCheckConfig', $actualFuncCall); - - $actualValue = $actualRequestObject->getParent(); - - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getUptimeCheckConfig(); - - $this->assertProtobufEquals($uptimeCheckConfig, $actualValue); - + $this->assertSame('/google.monitoring.v3.UptimeCheckService/GetUptimeCheckConfig', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function createUptimeCheckConfigExceptionTest() + public function getUptimeCheckConfigExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - // Mock request - $formattedParent = $client->projectName('[PROJECT]'); - $uptimeCheckConfig = new UptimeCheckConfig(); - + $formattedName = $client->uptimeCheckConfigName('[PROJECT]', '[UPTIME_CHECK_CONFIG]'); try { - $client->createUptimeCheckConfig($formattedParent, $uptimeCheckConfig); + $client->getUptimeCheckConfig($formattedName); // If the $client method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); } - // Call popReceivedCalls to ensure the stub is exhausted $transport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); @@ -315,75 +275,72 @@ public function createUptimeCheckConfigExceptionTest() /** * @test */ - public function updateUptimeCheckConfigTest() + public function listUptimeCheckConfigsTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $isInternal = true; - $expectedResponse = new UptimeCheckConfig(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setIsInternal($isInternal); + $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 - $uptimeCheckConfig = new UptimeCheckConfig(); - - $response = $client->updateUptimeCheckConfig($uptimeCheckConfig); - $this->assertEquals($expectedResponse, $response); + $parent = 'parent-995424086'; + $response = $client->listUptimeCheckConfigs($parent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getUptimeCheckConfigs()[0], $resources[0]); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.UptimeCheckService/UpdateUptimeCheckConfig', $actualFuncCall); - - $actualValue = $actualRequestObject->getUptimeCheckConfig(); - - $this->assertProtobufEquals($uptimeCheckConfig, $actualValue); - + $this->assertSame('/google.monitoring.v3.UptimeCheckService/ListUptimeCheckConfigs', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function updateUptimeCheckConfigExceptionTest() + public function listUptimeCheckConfigsExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], + $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(); - + $parent = 'parent-995424086'; try { - $client->updateUptimeCheckConfig($uptimeCheckConfig); + $client->listUptimeCheckConfigs($parent); // If the $client method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); } - // Call popReceivedCalls to ensure the stub is exhausted $transport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); @@ -392,68 +349,64 @@ public function updateUptimeCheckConfigExceptionTest() /** * @test */ - public function deleteUptimeCheckConfigTest() + public function listUptimeCheckIpsTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); + $nextPageToken = ''; + $uptimeCheckIpsElement = new UptimeCheckIp(); + $uptimeCheckIps = [ + $uptimeCheckIpsElement, + ]; + $expectedResponse = new ListUptimeCheckIpsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setUptimeCheckIps($uptimeCheckIps); $transport->addResponse($expectedResponse); - - // Mock request - $formattedName = $client->uptimeCheckConfigName('[PROJECT]', '[UPTIME_CHECK_CONFIG]'); - - $client->deleteUptimeCheckConfig($formattedName); + $response = $client->listUptimeCheckIps(); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getUptimeCheckIps()[0], $resources[0]); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.UptimeCheckService/DeleteUptimeCheckConfig', $actualFuncCall); - - $actualValue = $actualRequestObject->getName(); - - $this->assertProtobufEquals($formattedName, $actualValue); - + $this->assertSame('/google.monitoring.v3.UptimeCheckService/ListUptimeCheckIps', $actualFuncCall); $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function deleteUptimeCheckConfigExceptionTest() + public function listUptimeCheckIpsExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - - // Mock request - $formattedName = $client->uptimeCheckConfigName('[PROJECT]', '[UPTIME_CHECK_CONFIG]'); - try { - $client->deleteUptimeCheckConfig($formattedName); + $client->listUptimeCheckIps(); // If the $client method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); } - // Call popReceivedCalls to ensure the stub is exhausted $transport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); @@ -462,68 +415,66 @@ public function deleteUptimeCheckConfigExceptionTest() /** * @test */ - public function listUptimeCheckIpsTest() + public function updateUptimeCheckConfigTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $uptimeCheckIpsElement = new UptimeCheckIp(); - $uptimeCheckIps = [$uptimeCheckIpsElement]; - $expectedResponse = new ListUptimeCheckIpsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setUptimeCheckIps($uptimeCheckIps); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $isInternal = true; + $expectedResponse = new UptimeCheckConfig(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setIsInternal($isInternal); $transport->addResponse($expectedResponse); - - $response = $client->listUptimeCheckIps(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getUptimeCheckIps()[0], $resources[0]); - + // Mock request + $uptimeCheckConfig = new UptimeCheckConfig(); + $response = $client->updateUptimeCheckConfig($uptimeCheckConfig); + $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.UptimeCheckService/ListUptimeCheckIps', $actualFuncCall); - + $this->assertSame('/google.monitoring.v3.UptimeCheckService/UpdateUptimeCheckConfig', $actualFuncCall); + $actualValue = $actualRequestObject->getUptimeCheckConfig(); + $this->assertProtobufEquals($uptimeCheckConfig, $actualValue); $this->assertTrue($transport->isExhausted()); } /** * @test */ - public function listUptimeCheckIpsExceptionTest() + public function updateUptimeCheckConfigExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - + $client = $this->createClient([ + 'transport' => $transport, + ]); $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); - + // Mock request + $uptimeCheckConfig = new UptimeCheckConfig(); try { - $client->listUptimeCheckIps(); + $client->updateUptimeCheckConfig($uptimeCheckConfig); // If the $client method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); } - // Call popReceivedCalls to ensure the stub is exhausted $transport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); 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 e681f2e916e..00000000000 Binary files a/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Alert.php and /dev/null differ 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 b5ca2fc73a9..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‚Óä“%#/v3/{name=projects/*}/alertPoliciesÚAname– -GetAlertPolicy+.google.monitoring.v3.GetAlertPolicyRequest!.google.monitoring.v3.AlertPolicy"4‚Óä“\'%/v3/{name=projects/*/alertPolicies/*}ÚAnameµ -CreateAlertPolicy..google.monitoring.v3.CreateAlertPolicyRequest!.google.monitoring.v3.AlertPolicy"M‚Óä“3"#/v3/{name=projects/*}/alertPolicies: alert_policyÚAname,alert_policy‘ -DeleteAlertPolicy..google.monitoring.v3.DeleteAlertPolicyRequest.google.protobuf.Empty"4‚Óä“\'*%/v3/{name=projects/*/alertPolicies/*}ÚAnameË -UpdateAlertPolicy..google.monitoring.v3.UpdateAlertPolicyRequest!.google.monitoring.v3.AlertPolicy"c‚Óä“B22/v3/{alert_policy.name=projects/*/alertPolicies/*}: alert_policyÚAupdate_mask,alert_policy©ÊAmonitoring.googleapis.comÒA‰https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/monitoring,https://www.googleapis.com/auth/monitoring.readBÉ -com.google.monitoring.v3BAlertServiceProtoPZ>google.golang.org/genproto/googleapis/monitoring/v3;monitoringªGoogle.Cloud.Monitoring.V3ÊGoogle\\Cloud\\Monitoring\\V3êGoogle::Cloud::Monitoring::V3bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Common.php b/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Common.php deleted file mode 100644 index 57253ec061b..00000000000 Binary files a/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Common.php and /dev/null differ 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 7e7a042ea75..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.v3BDroppedLabelsProtoPZ>google.golang.org/genproto/googleapis/monitoring/v3;monitoringªGoogle.Cloud.Monitoring.V3ÊGoogle\\Cloud\\Monitoring\\V3êGoogle::Cloud::Monitoring::V3bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Group.php b/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Group.php deleted file mode 100644 index e3e95437843..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 -GroupProtoPZ>google.golang.org/genproto/googleapis/monitoring/v3;monitoringªGoogle.Cloud.Monitoring.V3ÊGoogle\\Cloud\\Monitoring\\V3êGoogle::Cloud::Monitoring::V3bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/GroupService.php b/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/GroupService.php deleted file mode 100644 index d1d73f8f1d7..00000000000 Binary files a/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/GroupService.php and /dev/null differ diff --git a/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Metric.php b/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Metric.php deleted file mode 100644 index af2fd6043ed..00000000000 Binary files a/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Metric.php and /dev/null differ 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 ba32291f711..00000000000 Binary files a/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/MetricService.php and /dev/null differ 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 605c2f19932..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.v3BMutationRecordProtoPZ>google.golang.org/genproto/googleapis/monitoring/v3;monitoringªGoogle.Cloud.Monitoring.V3ÊGoogle\\Cloud\\Monitoring\\V3êGoogle::Cloud::Monitoring::V3bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Notification.php b/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Notification.php deleted file mode 100644 index dc1082ca1ed..00000000000 Binary files a/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Notification.php and /dev/null differ 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 c99cbe7ef68..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/NotificationService.php +++ /dev/null @@ -1,98 +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/struct.protogoogle/protobuf/timestamp.proto"¡ -)ListNotificationChannelDescriptorsRequestM -name ( B?àAúA97monitoring.googleapis.com/NotificationChannelDescriptor - page_size ( - -page_token ( "— -*ListNotificationChannelDescriptorsResponseP -channel_descriptors ( 23.google.monitoring.v3.NotificationChannelDescriptor -next_page_token ( "x -\'GetNotificationChannelDescriptorRequestM -name ( B?àAúA9 -7monitoring.googleapis.com/NotificationChannelDescriptor"µ - CreateNotificationChannelRequestC -name ( B5àAúA/-monitoring.googleapis.com/NotificationChannelL -notification_channel ( 2).google.monitoring.v3.NotificationChannelBàA"¯ -ListNotificationChannelsRequestC -name ( B5àAúA/-monitoring.googleapis.com/NotificationChannel -filter (  -order_by (  - page_size ( - -page_token ( "™ - ListNotificationChannelsResponseH -notification_channels ( 2).google.monitoring.v3.NotificationChannel -next_page_token (  - -total_size ("d -GetNotificationChannelRequestC -name ( B5àAúA/ --monitoring.googleapis.com/NotificationChannel"¡ - UpdateNotificationChannelRequest/ - update_mask ( 2.google.protobuf.FieldMaskL -notification_channel ( 2).google.monitoring.v3.NotificationChannelBàA"v - DeleteNotificationChannelRequestC -name ( B5àAúA/ --monitoring.googleapis.com/NotificationChannel -force ("u -.SendNotificationChannelVerificationCodeRequestC -name ( B5àAúA/ --monitoring.googleapis.com/NotificationChannel"¥ --GetNotificationChannelVerificationCodeRequestC -name ( B5àAúA/ --monitoring.googleapis.com/NotificationChannel/ - expire_time ( 2.google.protobuf.Timestamp"o -.GetNotificationChannelVerificationCodeResponse -code ( / - expire_time ( 2.google.protobuf.Timestamp"z - VerifyNotificationChannelRequestC -name ( B5àAúA/ --monitoring.googleapis.com/NotificationChannel -code ( BàA2ê -NotificationChannelServiceì -"ListNotificationChannelDescriptors?.google.monitoring.v3.ListNotificationChannelDescriptorsRequest@.google.monitoring.v3.ListNotificationChannelDescriptorsResponse"C‚Óä“64/v3/{name=projects/*}/notificationChannelDescriptorsÚAnameÝ - GetNotificationChannelDescriptor=.google.monitoring.v3.GetNotificationChannelDescriptorRequest3.google.monitoring.v3.NotificationChannelDescriptor"E‚Óä“86/v3/{name=projects/*/notificationChannelDescriptors/*}ÚAnameÄ -ListNotificationChannels5.google.monitoring.v3.ListNotificationChannelsRequest6.google.monitoring.v3.ListNotificationChannelsResponse"9‚Óä“,*/v3/{name=projects/*}/notificationChannelsÚAnameµ -GetNotificationChannel3.google.monitoring.v3.GetNotificationChannelRequest).google.monitoring.v3.NotificationChannel";‚Óä“.,/v3/{name=projects/*/notificationChannels/*}ÚAnameä -CreateNotificationChannel6.google.monitoring.v3.CreateNotificationChannelRequest).google.monitoring.v3.NotificationChannel"d‚Óä“B"*/v3/{name=projects/*}/notificationChannels:notification_channelÚAname,notification_channelƒ -UpdateNotificationChannel6.google.monitoring.v3.UpdateNotificationChannelRequest).google.monitoring.v3.NotificationChannel"‚‚Óä“Y2A/v3/{notification_channel.name=projects/*/notificationChannels/*}:notification_channelÚA update_mask,notification_channel® -DeleteNotificationChannel6.google.monitoring.v3.DeleteNotificationChannelRequest.google.protobuf.Empty"A‚Óä“.*,/v3/{name=projects/*/notificationChannels/*}ÚA -name,forceÜ -\'SendNotificationChannelVerificationCodeD.google.monitoring.v3.SendNotificationChannelVerificationCodeRequest.google.protobuf.Empty"S‚Óä“F"A/v3/{name=projects/*/notificationChannels/*}:sendVerificationCode:*ÚAname‡ -&GetNotificationChannelVerificationCodeC.google.monitoring.v3.GetNotificationChannelVerificationCodeRequestD.google.monitoring.v3.GetNotificationChannelVerificationCodeResponse"R‚Óä“E"@/v3/{name=projects/*/notificationChannels/*}:getVerificationCode:*ÚAnameÊ -VerifyNotificationChannel6.google.monitoring.v3.VerifyNotificationChannelRequest).google.monitoring.v3.NotificationChannel"J‚Óä“8"3/v3/{name=projects/*/notificationChannels/*}:verify:*ÚA name,code©ÊAmonitoring.googleapis.comÒA‰https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/monitoring,https://www.googleapis.com/auth/monitoring.readBÐ -com.google.monitoring.v3BNotificationServiceProtoPZ>google.golang.org/genproto/googleapis/monitoring/v3;monitoringªGoogle.Cloud.Monitoring.V3ÊGoogle\\Cloud\\Monitoring\\V3êGoogle::Cloud::Monitoring::V3bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Service.php b/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Service.php deleted file mode 100644 index 4aef5a25c91..00000000000 Binary files a/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Service.php and /dev/null differ diff --git a/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/ServiceService.php b/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/ServiceService.php deleted file mode 100644 index f1b7d60262f..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/ServiceService.php +++ /dev/null @@ -1,95 +0,0 @@ -internalAddGeneratedFile( - ' -ð -*google/monitoring/v3/service_service.protogoogle.monitoring.v3google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto"google/monitoring/v3/service.protogoogle/protobuf/empty.proto google/protobuf/field_mask.proto"š -CreateServiceRequest9 -parent ( B)àAúA#!monitoring.googleapis.com/Service - -service_id ( 3 -service ( 2.google.monitoring.v3.ServiceBàA"L -GetServiceRequest7 -name ( B)àAúA# -!monitoring.googleapis.com/Service"‡ -ListServicesRequest9 -parent ( B)àAúA#!monitoring.googleapis.com/Service -filter (  - page_size ( - -page_token ( "` -ListServicesResponse/ -services ( 2.google.monitoring.v3.Service -next_page_token ( "| -UpdateServiceRequest3 -service ( 2.google.monitoring.v3.ServiceBàA/ - update_mask ( 2.google.protobuf.FieldMask"O -DeleteServiceRequest7 -name ( B)àAúA# -!monitoring.googleapis.com/Service"Ö -"CreateServiceLevelObjectiveRequest9 -parent ( B)àAúA# -!monitoring.googleapis.com/Service" -service_level_objective_id ( Q -service_level_objective ( 2+.google.monitoring.v3.ServiceLevelObjectiveBàA"¨ -GetServiceLevelObjectiveRequestE -name ( B7àAúA1 -/monitoring.googleapis.com/ServiceLevelObjective> -view (20.google.monitoring.v3.ServiceLevelObjective.View"Õ -!ListServiceLevelObjectivesRequest9 -parent ( B)àAúA# -!monitoring.googleapis.com/Service -filter (  - page_size ( - -page_token ( > -view (20.google.monitoring.v3.ServiceLevelObjective.View"Œ -"ListServiceLevelObjectivesResponseM -service_level_objectives ( 2+.google.monitoring.v3.ServiceLevelObjective -next_page_token ( "¨ -"UpdateServiceLevelObjectiveRequestQ -service_level_objective ( 2+.google.monitoring.v3.ServiceLevelObjectiveBàA/ - update_mask ( 2.google.protobuf.FieldMask"k -"DeleteServiceLevelObjectiveRequestE -name ( B7àAúA1 -/monitoring.googleapis.com/ServiceLevelObjective2ê -ServiceMonitoringService— - CreateService*.google.monitoring.v3.CreateServiceRequest.google.monitoring.v3.Service";‚Óä“$"/v3/{parent=*/*}/services:serviceÚAparent,service~ - -GetService\'.google.monitoring.v3.GetServiceRequest.google.monitoring.v3.Service"(‚Óä“/v3/{name=*/*/services/*}ÚAname‘ - ListServices).google.monitoring.v3.ListServicesRequest*.google.monitoring.v3.ListServicesResponse"*‚Óä“/v3/{parent=*/*}/servicesÚAparent˜ - UpdateService*.google.monitoring.v3.UpdateServiceRequest.google.monitoring.v3.Service"<‚Óä“,2!/v3/{service.name=*/*/services/*}:serviceÚAservice} - DeleteService*.google.monitoring.v3.DeleteServiceRequest.google.protobuf.Empty"(‚Óä“*/v3/{name=*/*/services/*}ÚAnameú -CreateServiceLevelObjective8.google.monitoring.v3.CreateServiceLevelObjectiveRequest+.google.monitoring.v3.ServiceLevelObjective"t‚Óä“M"2/v3/{parent=*/*/services/*}/serviceLevelObjectives:service_level_objectiveÚAparent,service_level_objectiveÁ -GetServiceLevelObjective5.google.monitoring.v3.GetServiceLevelObjectiveRequest+.google.monitoring.v3.ServiceLevelObjective"A‚Óä“42/v3/{name=*/*/services/*/serviceLevelObjectives/*}ÚAnameÔ -ListServiceLevelObjectives7.google.monitoring.v3.ListServiceLevelObjectivesRequest8.google.monitoring.v3.ListServiceLevelObjectivesResponse"C‚Óä“42/v3/{parent=*/*/services/*}/serviceLevelObjectivesÚAparentŒ -UpdateServiceLevelObjective8.google.monitoring.v3.UpdateServiceLevelObjectiveRequest+.google.monitoring.v3.ServiceLevelObjective"…‚Óä“e2J/v3/{service_level_objective.name=*/*/services/*/serviceLevelObjectives/*}:service_level_objectiveÚAservice_level_objective² -DeleteServiceLevelObjective8.google.monitoring.v3.DeleteServiceLevelObjectiveRequest.google.protobuf.Empty"A‚Óä“4*2/v3/{name=*/*/services/*/serviceLevelObjectives/*}ÚAname©ÊAmonitoring.googleapis.comÒA‰https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/monitoring,https://www.googleapis.com/auth/monitoring.readBÕ -com.google.monitoring.v3BServiceMonitoringServiceProtoPZ>google.golang.org/genproto/googleapis/monitoring/v3;monitoringªGoogle.Cloud.Monitoring.V3ÊGoogle\\Cloud\\Monitoring\\V3êGoogle::Cloud::Monitoring::V3bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/SpanContext.php b/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/SpanContext.php deleted file mode 100644 index 959e03af5ad..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.v3BSpanContextProtoPZ>google.golang.org/genproto/googleapis/monitoring/v3;monitoringªGoogle.Cloud.Monitoring.V3ÊGoogle\\Cloud\\Monitoring\\V3êGoogle::Cloud::Monitoring::V3bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Uptime.php b/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Uptime.php deleted file mode 100644 index 21923666291..00000000000 Binary files a/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/Uptime.php and /dev/null differ diff --git a/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/UptimeService.php b/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/UptimeService.php deleted file mode 100644 index 3f79d39437f..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/GPBMetadata/Google/Monitoring/V3/UptimeService.php +++ /dev/null @@ -1,73 +0,0 @@ -internalAddGeneratedFile( - ' -Ê -)google/monitoring/v3/uptime_service.protogoogle.monitoring.v3google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto#google/longrunning/operations.proto!google/monitoring/v3/uptime.protogoogle/protobuf/duration.protogoogle/protobuf/empty.proto google/protobuf/field_mask.proto"‹ -ListUptimeCheckConfigsRequestC -parent ( B3àAúA-+monitoring.googleapis.com/UptimeCheckConfig - page_size ( - -page_token ( "” -ListUptimeCheckConfigsResponseE -uptime_check_configs ( 2\'.google.monitoring.v3.UptimeCheckConfig -next_page_token (  - -total_size ("` -GetUptimeCheckConfigRequestA -name ( B3àAúA- -+monitoring.googleapis.com/UptimeCheckConfig"° -CreateUptimeCheckConfigRequestC -parent ( B3àAúA-+monitoring.googleapis.com/UptimeCheckConfigI -uptime_check_config ( 2\'.google.monitoring.v3.UptimeCheckConfigBàA"œ -UpdateUptimeCheckConfigRequest/ - update_mask ( 2.google.protobuf.FieldMaskI -uptime_check_config ( 2\'.google.monitoring.v3.UptimeCheckConfigBàA"c -DeleteUptimeCheckConfigRequestA -name ( B3àAúA- -+monitoring.googleapis.com/UptimeCheckConfig"B -ListUptimeCheckIpsRequest - page_size ( - -page_token ( "t -ListUptimeCheckIpsResponse= -uptime_check_ips ( 2#.google.monitoring.v3.UptimeCheckIp -next_page_token ( 2½ - -UptimeCheckServiceÀ -ListUptimeCheckConfigs3.google.monitoring.v3.ListUptimeCheckConfigsRequest4.google.monitoring.v3.ListUptimeCheckConfigsResponse";‚Óä“,*/v3/{parent=projects/*}/uptimeCheckConfigsÚAparent­ -GetUptimeCheckConfig1.google.monitoring.v3.GetUptimeCheckConfigRequest\'.google.monitoring.v3.UptimeCheckConfig"9‚Óä“,*/v3/{name=projects/*/uptimeCheckConfigs/*}ÚAnameÞ -CreateUptimeCheckConfig4.google.monitoring.v3.CreateUptimeCheckConfigRequest\'.google.monitoring.v3.UptimeCheckConfig"d‚Óä“A"*/v3/{parent=projects/*}/uptimeCheckConfigs:uptime_check_configÚAparent,uptime_check_configë -UpdateUptimeCheckConfig4.google.monitoring.v3.UpdateUptimeCheckConfigRequest\'.google.monitoring.v3.UptimeCheckConfig"q‚Óä“U2>/v3/{uptime_check_config.name=projects/*/uptimeCheckConfigs/*}:uptime_check_configÚAuptime_check_config¢ -DeleteUptimeCheckConfig4.google.monitoring.v3.DeleteUptimeCheckConfigRequest.google.protobuf.Empty"9‚Óä“,**/v3/{name=projects/*/uptimeCheckConfigs/*}ÚAname“ -ListUptimeCheckIps/.google.monitoring.v3.ListUptimeCheckIpsRequest0.google.monitoring.v3.ListUptimeCheckIpsResponse"‚Óä“/v3/uptimeCheckIps©ÊAmonitoring.googleapis.comÒA‰https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/monitoring,https://www.googleapis.com/auth/monitoring.readBÊ -com.google.monitoring.v3BUptimeServiceProtoPZ>google.golang.org/genproto/googleapis/monitoring/v3;monitoringªGoogle.Cloud.Monitoring.V3ÊGoogle\\Cloud\\Monitoring\\V3êGoogle::Cloud::Monitoring::V3bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Aggregation.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Aggregation.php deleted file mode 100644 index b5acffa4411..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 string[]|\Google\Protobuf\Internal\RepeatedField $group_by_fields - * The set of fields to preserve when `cross_series_reducer` is - * specified. The `group_by_fields` determine how the time series are - * partitioned into subsets prior to applying the aggregation - * operation. Each subset contains time series that have the same - * value for each of the grouping fields. Each individual time - * series is a member of exactly one subset. The - * `cross_series_reducer` is applied to each subset of time series. - * It is not possible to reduce across different resource types, so - * this field implicitly contains `resource.type`. Fields not - * specified in `group_by_fields` are aggregated away. If - * `group_by_fields` is not specified and all the time series have - * the same resource type, then the time series are aggregated into - * a single output time series. If `cross_series_reducer` is not - * defined, this field is ignored. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\Common::initOnce(); - parent::__construct($data); - } - - /** - * The `alignment_period` specifies a time interval, in seconds, that is used - * to divide the data in all the - * [time series][google.monitoring.v3.TimeSeries] into consistent blocks of - * time. This will be done before the per-series aligner can be applied to - * the data. - * The value must be at least 60 seconds. If a per-series - * aligner other than `ALIGN_NONE` is specified, this field is required or an - * error is returned. If no per-series aligner is specified, or the aligner - * `ALIGN_NONE` is specified, then this field is ignored. - * The maximum value of the `alignment_period` is 104 weeks (2 years) for - * charts, and 90,000 seconds (25 hours) for alerting policies. - * - * Generated from protobuf field .google.protobuf.Duration alignment_period = 1; - * @return \Google\Protobuf\Duration|null - */ - public function getAlignmentPeriod() - { - return $this->alignment_period; - } - - public function hasAlignmentPeriod() - { - return isset($this->alignment_period); - } - - public function clearAlignmentPeriod() - { - unset($this->alignment_period); - } - - /** - * The `alignment_period` specifies a time interval, in seconds, that is used - * to divide the data in all the - * [time series][google.monitoring.v3.TimeSeries] into consistent blocks of - * time. This will be done before the per-series aligner can be applied to - * the data. - * The value must be at least 60 seconds. If a per-series - * aligner other than `ALIGN_NONE` is specified, this field is required or an - * error is returned. If no per-series aligner is specified, or the aligner - * `ALIGN_NONE` is specified, then this field is ignored. - * The maximum value of the `alignment_period` is 104 weeks (2 years) for - * charts, and 90,000 seconds (25 hours) for alerting policies. - * - * Generated from protobuf field .google.protobuf.Duration alignment_period = 1; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setAlignmentPeriod($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->alignment_period = $var; - - return $this; - } - - /** - * An `Aligner` describes how to bring the data points in a single - * time series into temporal alignment. Except for `ALIGN_NONE`, all - * alignments cause all the data points in an `alignment_period` to be - * mathematically grouped together, resulting in a single data point for - * each `alignment_period` with end timestamp at the end of the period. - * Not all alignment operations may be applied to all time series. The valid - * choices depend on the `metric_kind` and `value_type` of the original time - * series. Alignment can change the `metric_kind` or the `value_type` of - * the time series. - * Time series data must be aligned in order to perform cross-time - * series reduction. If `cross_series_reducer` is specified, then - * `per_series_aligner` must be specified and not equal to `ALIGN_NONE` - * and `alignment_period` must be specified; otherwise, an error is - * returned. - * - * Generated from protobuf field .google.monitoring.v3.Aggregation.Aligner per_series_aligner = 2; - * @return int - */ - public function getPerSeriesAligner() - { - return $this->per_series_aligner; - } - - /** - * An `Aligner` describes how to bring the data points in a single - * time series into temporal alignment. Except for `ALIGN_NONE`, all - * alignments cause all the data points in an `alignment_period` to be - * mathematically grouped together, resulting in a single data point for - * each `alignment_period` with end timestamp at the end of the period. - * Not all alignment operations may be applied to all time series. The valid - * choices depend on the `metric_kind` and `value_type` of the original time - * series. Alignment can change the `metric_kind` or the `value_type` of - * the time series. - * Time series data must be aligned in order to perform cross-time - * series reduction. If `cross_series_reducer` is specified, then - * `per_series_aligner` must be specified and not equal to `ALIGN_NONE` - * and `alignment_period` must be specified; otherwise, an error is - * returned. - * - * Generated from protobuf field .google.monitoring.v3.Aggregation.Aligner per_series_aligner = 2; - * @param int $var - * @return $this - */ - public function setPerSeriesAligner($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\Aggregation\Aligner::class); - $this->per_series_aligner = $var; - - return $this; - } - - /** - * The reduction operation to be used to combine time series into a single - * time series, where the value of each data point in the resulting series is - * a function of all the already aligned values in the input time series. - * Not all reducer operations can be applied to all time series. The valid - * choices depend on the `metric_kind` and the `value_type` of the original - * time series. Reduction can yield a time series with a different - * `metric_kind` or `value_type` than the input time series. - * Time series data must first be aligned (see `per_series_aligner`) in order - * to perform cross-time series reduction. If `cross_series_reducer` is - * specified, then `per_series_aligner` must be specified, and must not be - * `ALIGN_NONE`. An `alignment_period` must also be specified; otherwise, an - * error is returned. - * - * Generated from protobuf field .google.monitoring.v3.Aggregation.Reducer cross_series_reducer = 4; - * @return int - */ - public function getCrossSeriesReducer() - { - return $this->cross_series_reducer; - } - - /** - * The reduction operation to be used to combine time series into a single - * time series, where the value of each data point in the resulting series is - * a function of all the already aligned values in the input time series. - * Not all reducer operations can be applied to all time series. The valid - * choices depend on the `metric_kind` and the `value_type` of the original - * time series. Reduction can yield a time series with a different - * `metric_kind` or `value_type` than the input time series. - * Time series data must first be aligned (see `per_series_aligner`) in order - * to perform cross-time series reduction. If `cross_series_reducer` is - * specified, then `per_series_aligner` must be specified, and must not be - * `ALIGN_NONE`. An `alignment_period` must also be specified; otherwise, an - * error is returned. - * - * Generated from protobuf field .google.monitoring.v3.Aggregation.Reducer cross_series_reducer = 4; - * @param int $var - * @return $this - */ - public function setCrossSeriesReducer($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\Aggregation\Reducer::class); - $this->cross_series_reducer = $var; - - return $this; - } - - /** - * The set of fields to preserve when `cross_series_reducer` is - * specified. The `group_by_fields` determine how the time series are - * partitioned into subsets prior to applying the aggregation - * operation. Each subset contains time series that have the same - * value for each of the grouping fields. Each individual time - * series is a member of exactly one subset. The - * `cross_series_reducer` is applied to each subset of time series. - * It is not possible to reduce across different resource types, so - * this field implicitly contains `resource.type`. Fields not - * specified in `group_by_fields` are aggregated away. If - * `group_by_fields` is not specified and all the time series have - * the same resource type, then the time series are aggregated into - * a single output time series. If `cross_series_reducer` is not - * defined, this field is ignored. - * - * Generated from protobuf field repeated string group_by_fields = 5; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getGroupByFields() - { - return $this->group_by_fields; - } - - /** - * The set of fields to preserve when `cross_series_reducer` is - * specified. The `group_by_fields` determine how the time series are - * partitioned into subsets prior to applying the aggregation - * operation. Each subset contains time series that have the same - * value for each of the grouping fields. Each individual time - * series is a member of exactly one subset. The - * `cross_series_reducer` is applied to each subset of time series. - * It is not possible to reduce across different resource types, so - * this field implicitly contains `resource.type`. Fields not - * specified in `group_by_fields` are aggregated away. If - * `group_by_fields` is not specified and all the time series have - * the same resource type, then the time series are aggregated into - * a single output time series. If `cross_series_reducer` is not - * defined, this field is ignored. - * - * Generated from protobuf field repeated string group_by_fields = 5; - * @param string[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setGroupByFields($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->group_by_fields = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Aggregation/Aligner.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Aggregation/Aligner.php 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/Aggregation_Aligner.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Aggregation_Aligner.php deleted file mode 100644 index 39d191200d7..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Aggregation_Aligner.php +++ /dev/null @@ -1,16 +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 Stackdriver Monitoring when the policy - * is created. When calling the - * [alertPolicies.create][google.monitoring.v3.AlertPolicyService.CreateAlertPolicy] - * method, do not include the `name` field in the alerting policy passed as - * part of the request. - * - * Generated from protobuf field string name = 1; - */ - protected $name = ''; - /** - * A short name or phrase used to identify the policy in dashboards, - * notifications, and incidents. To avoid confusion, don't use the same - * display name for multiple policies in the same project. The name is - * limited to 512 Unicode characters. - * - * Generated from protobuf field string display_name = 2; - */ - protected $display_name = ''; - /** - * Documentation that is included with notifications and incidents related to - * this policy. Best practice is for the documentation to include information - * to help responders understand, mitigate, escalate, and correct the - * underlying problems detected by the alerting policy. Notification channels - * that have limited capacity might not show this documentation. - * - * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Documentation documentation = 13; - */ - protected $documentation = null; - /** - * User-supplied key/value data to be used for organizing and - * identifying the `AlertPolicy` objects. - * The field can contain up to 64 entries. Each key and value is limited to - * 63 Unicode characters or 128 bytes, whichever is smaller. Labels and - * values can contain only lowercase letters, numerals, underscores, and - * dashes. Keys must begin with a letter. - * - * Generated from protobuf field map user_labels = 16; - */ - private $user_labels; - /** - * A list of conditions for the policy. The conditions are combined by AND or - * OR according to the `combiner` field. If the combined conditions evaluate - * to true, then an incident is created. A policy can have from one to six - * conditions. - * If `condition_time_series_query_language` is present, it must be the only - * `condition`. - * - * Generated from protobuf field repeated .google.monitoring.v3.AlertPolicy.Condition conditions = 12; - */ - private $conditions; - /** - * How to combine the results of multiple conditions to determine if an - * incident should be opened. - * If `condition_time_series_query_language` is present, this must be - * `COMBINE_UNSPECIFIED`. - * - * Generated from protobuf field .google.monitoring.v3.AlertPolicy.ConditionCombinerType combiner = 6; - */ - protected $combiner = 0; - /** - * Whether or not the policy is enabled. On write, the default interpretation - * if unset is that the policy is enabled. On read, clients should not make - * any assumption about the state if it has not been populated. The - * field should always be populated on List and Get operations, unless - * a field projection has been specified that strips it out. - * - * Generated from protobuf field .google.protobuf.BoolValue enabled = 17; - */ - protected $enabled = null; - /** - * Read-only description of how the alert policy is invalid. OK if the alert - * policy is valid. If not OK, the alert policy will not generate incidents. - * - * Generated from protobuf field .google.rpc.Status validity = 18; - */ - protected $validity = null; - /** - * Identifies the notification channels to which notifications should be sent - * when incidents are opened or closed or when new violations occur on - * an already opened incident. Each element of this array corresponds to - * the `name` field in each of the - * [`NotificationChannel`][google.monitoring.v3.NotificationChannel] - * objects that are returned from the [`ListNotificationChannels`] - * [google.monitoring.v3.NotificationChannelService.ListNotificationChannels] - * method. The format of the entries in this field is: - * projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] - * - * Generated from protobuf field repeated string notification_channels = 14; - */ - private $notification_channels; - /** - * A read-only record of the creation of the alerting policy. If provided - * in a call to create or update, this field will be ignored. - * - * Generated from protobuf field .google.monitoring.v3.MutationRecord creation_record = 10; - */ - protected $creation_record = null; - /** - * A read-only record of the most recent change to the alerting policy. If - * provided in a call to create or update, this field will be ignored. - * - * Generated from protobuf field .google.monitoring.v3.MutationRecord mutation_record = 11; - */ - protected $mutation_record = null; - /** - * Control over how this alert policy's notification channels are notified. - * - * Generated from protobuf field .google.monitoring.v3.AlertPolicy.AlertStrategy alert_strategy = 21; - */ - protected $alert_strategy = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required if the policy exists. The resource name for this policy. The - * format is: - * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] - * `[ALERT_POLICY_ID]` is assigned by Stackdriver Monitoring when the policy - * is created. When calling the - * [alertPolicies.create][google.monitoring.v3.AlertPolicyService.CreateAlertPolicy] - * method, do not include the `name` field in the alerting policy passed as - * part of the request. - * @type string $display_name - * A short name or phrase used to identify the policy in dashboards, - * notifications, and incidents. To avoid confusion, don't use the same - * display name for multiple policies in the same project. The name is - * limited to 512 Unicode characters. - * @type \Google\Cloud\Monitoring\V3\AlertPolicy\Documentation $documentation - * Documentation that is included with notifications and incidents related to - * this policy. Best practice is for the documentation to include information - * to help responders understand, mitigate, escalate, and correct the - * underlying problems detected by the alerting policy. Notification channels - * that have limited capacity might not show this documentation. - * @type array|\Google\Protobuf\Internal\MapField $user_labels - * User-supplied key/value data to be used for organizing and - * identifying the `AlertPolicy` objects. - * The field can contain up to 64 entries. Each key and value is limited to - * 63 Unicode characters or 128 bytes, whichever is smaller. Labels and - * values can contain only lowercase letters, numerals, underscores, and - * dashes. Keys must begin with a letter. - * @type \Google\Cloud\Monitoring\V3\AlertPolicy\Condition[]|\Google\Protobuf\Internal\RepeatedField $conditions - * A list of conditions for the policy. The conditions are combined by AND or - * OR according to the `combiner` field. If the combined conditions evaluate - * to true, then an incident is created. A policy can have from one to six - * conditions. - * If `condition_time_series_query_language` is present, it must be the only - * `condition`. - * @type int $combiner - * How to combine the results of multiple conditions to determine if an - * incident should be opened. - * If `condition_time_series_query_language` is present, this must be - * `COMBINE_UNSPECIFIED`. - * @type \Google\Protobuf\BoolValue $enabled - * Whether or not the policy is enabled. On write, the default interpretation - * if unset is that the policy is enabled. On read, clients should not make - * any assumption about the state if it has not been populated. The - * field should always be populated on List and Get operations, unless - * a field projection has been specified that strips it out. - * @type \Google\Rpc\Status $validity - * Read-only description of how the alert policy is invalid. OK if the alert - * policy is valid. If not OK, the alert policy will not generate incidents. - * @type string[]|\Google\Protobuf\Internal\RepeatedField $notification_channels - * Identifies the notification channels to which notifications should be sent - * when incidents are opened or closed or when new violations occur on - * an already opened incident. Each element of this array corresponds to - * the `name` field in each of the - * [`NotificationChannel`][google.monitoring.v3.NotificationChannel] - * objects that are returned from the [`ListNotificationChannels`] - * [google.monitoring.v3.NotificationChannelService.ListNotificationChannels] - * method. The format of the entries in this field is: - * projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] - * @type \Google\Cloud\Monitoring\V3\MutationRecord $creation_record - * A read-only record of the creation of the alerting policy. If provided - * in a call to create or update, this field will be ignored. - * @type \Google\Cloud\Monitoring\V3\MutationRecord $mutation_record - * A read-only record of the most recent change to the alerting policy. If - * provided in a call to create or update, this field will be ignored. - * @type \Google\Cloud\Monitoring\V3\AlertPolicy\AlertStrategy $alert_strategy - * Control over how this alert policy's notification channels are notified. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\Alert::initOnce(); - parent::__construct($data); - } - - /** - * Required if the policy exists. The resource name for this policy. The - * format is: - * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] - * `[ALERT_POLICY_ID]` is assigned by Stackdriver Monitoring when the policy - * is created. When calling the - * [alertPolicies.create][google.monitoring.v3.AlertPolicyService.CreateAlertPolicy] - * method, do not include the `name` field in the alerting policy passed as - * part of the request. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required if the policy exists. The resource name for this policy. The - * format is: - * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] - * `[ALERT_POLICY_ID]` is assigned by Stackdriver Monitoring when the policy - * is created. When calling the - * [alertPolicies.create][google.monitoring.v3.AlertPolicyService.CreateAlertPolicy] - * method, do not include the `name` field in the alerting policy passed as - * part of the request. - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * A short name or phrase used to identify the policy in dashboards, - * notifications, and incidents. To avoid confusion, don't use the same - * display name for multiple policies in the same project. The name is - * limited to 512 Unicode characters. - * - * Generated from protobuf field string display_name = 2; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * A short name or phrase used to identify the policy in dashboards, - * notifications, and incidents. To avoid confusion, don't use the same - * display name for multiple policies in the same project. The name is - * limited to 512 Unicode characters. - * - * Generated from protobuf field string display_name = 2; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - - /** - * Documentation that is included with notifications and incidents related to - * this policy. Best practice is for the documentation to include information - * to help responders understand, mitigate, escalate, and correct the - * underlying problems detected by the alerting policy. Notification channels - * that have limited capacity might not show this documentation. - * - * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Documentation documentation = 13; - * @return \Google\Cloud\Monitoring\V3\AlertPolicy\Documentation|null - */ - public function getDocumentation() - { - return $this->documentation; - } - - public function hasDocumentation() - { - return isset($this->documentation); - } - - public function clearDocumentation() - { - unset($this->documentation); - } - - /** - * Documentation that is included with notifications and incidents related to - * this policy. Best practice is for the documentation to include information - * to help responders understand, mitigate, escalate, and correct the - * underlying problems detected by the alerting policy. Notification channels - * that have limited capacity might not show this documentation. - * - * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Documentation documentation = 13; - * @param \Google\Cloud\Monitoring\V3\AlertPolicy\Documentation $var - * @return $this - */ - public function setDocumentation($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\AlertPolicy\Documentation::class); - $this->documentation = $var; - - return $this; - } - - /** - * User-supplied key/value data to be used for organizing and - * identifying the `AlertPolicy` objects. - * The field can contain up to 64 entries. Each key and value is limited to - * 63 Unicode characters or 128 bytes, whichever is smaller. Labels and - * values can contain only lowercase letters, numerals, underscores, and - * dashes. Keys must begin with a letter. - * - * Generated from protobuf field map user_labels = 16; - * @return \Google\Protobuf\Internal\MapField - */ - public function getUserLabels() - { - return $this->user_labels; - } - - /** - * User-supplied key/value data to be used for organizing and - * identifying the `AlertPolicy` objects. - * The field can contain up to 64 entries. Each key and value is limited to - * 63 Unicode characters or 128 bytes, whichever is smaller. Labels and - * values can contain only lowercase letters, numerals, underscores, and - * dashes. Keys must begin with a letter. - * - * Generated from protobuf field map user_labels = 16; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setUserLabels($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->user_labels = $arr; - - return $this; - } - - /** - * A list of conditions for the policy. The conditions are combined by AND or - * OR according to the `combiner` field. If the combined conditions evaluate - * to true, then an incident is created. A policy can have from one to six - * conditions. - * If `condition_time_series_query_language` is present, it must be the only - * `condition`. - * - * Generated from protobuf field repeated .google.monitoring.v3.AlertPolicy.Condition conditions = 12; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getConditions() - { - return $this->conditions; - } - - /** - * A list of conditions for the policy. The conditions are combined by AND or - * OR according to the `combiner` field. If the combined conditions evaluate - * to true, then an incident is created. A policy can have from one to six - * conditions. - * If `condition_time_series_query_language` is present, it must be the only - * `condition`. - * - * Generated from protobuf field repeated .google.monitoring.v3.AlertPolicy.Condition conditions = 12; - * @param \Google\Cloud\Monitoring\V3\AlertPolicy\Condition[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setConditions($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\AlertPolicy\Condition::class); - $this->conditions = $arr; - - return $this; - } - - /** - * How to combine the results of multiple conditions to determine if an - * incident should be opened. - * If `condition_time_series_query_language` is present, this must be - * `COMBINE_UNSPECIFIED`. - * - * Generated from protobuf field .google.monitoring.v3.AlertPolicy.ConditionCombinerType combiner = 6; - * @return int - */ - public function getCombiner() - { - return $this->combiner; - } - - /** - * How to combine the results of multiple conditions to determine if an - * incident should be opened. - * If `condition_time_series_query_language` is present, this must be - * `COMBINE_UNSPECIFIED`. - * - * Generated from protobuf field .google.monitoring.v3.AlertPolicy.ConditionCombinerType combiner = 6; - * @param int $var - * @return $this - */ - public function setCombiner($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\AlertPolicy\ConditionCombinerType::class); - $this->combiner = $var; - - return $this; - } - - /** - * Whether or not the policy is enabled. On write, the default interpretation - * if unset is that the policy is enabled. On read, clients should not make - * any assumption about the state if it has not been populated. The - * field should always be populated on List and Get operations, unless - * a field projection has been specified that strips it out. - * - * Generated from protobuf field .google.protobuf.BoolValue enabled = 17; - * @return \Google\Protobuf\BoolValue|null - */ - public function getEnabled() - { - return $this->enabled; - } - - public function hasEnabled() - { - return isset($this->enabled); - } - - public function clearEnabled() - { - unset($this->enabled); - } - - /** - * Returns the unboxed value from getEnabled() - - * Whether or not the policy is enabled. On write, the default interpretation - * if unset is that the policy is enabled. On read, clients should not make - * any assumption about the state if it has not been populated. The - * field should always be populated on List and Get operations, unless - * a field projection has been specified that strips it out. - * - * Generated from protobuf field .google.protobuf.BoolValue enabled = 17; - * @return bool|null - */ - public function getEnabledUnwrapped() - { - return $this->readWrapperValue("enabled"); - } - - /** - * Whether or not the policy is enabled. On write, the default interpretation - * if unset is that the policy is enabled. On read, clients should not make - * any assumption about the state if it has not been populated. The - * field should always be populated on List and Get operations, unless - * a field projection has been specified that strips it out. - * - * Generated from protobuf field .google.protobuf.BoolValue enabled = 17; - * @param \Google\Protobuf\BoolValue $var - * @return $this - */ - public function setEnabled($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\BoolValue::class); - $this->enabled = $var; - - return $this; - } - - /** - * Sets the field by wrapping a primitive type in a Google\Protobuf\BoolValue object. - - * Whether or not the policy is enabled. On write, the default interpretation - * if unset is that the policy is enabled. On read, clients should not make - * any assumption about the state if it has not been populated. The - * field should always be populated on List and Get operations, unless - * a field projection has been specified that strips it out. - * - * Generated from protobuf field .google.protobuf.BoolValue enabled = 17; - * @param bool|null $var - * @return $this - */ - public function setEnabledUnwrapped($var) - { - $this->writeWrapperValue("enabled", $var); - return $this;} - - /** - * Read-only description of how the alert policy is invalid. OK if the alert - * policy is valid. If not OK, the alert policy will not generate incidents. - * - * Generated from protobuf field .google.rpc.Status validity = 18; - * @return \Google\Rpc\Status|null - */ - public function getValidity() - { - return $this->validity; - } - - public function hasValidity() - { - return isset($this->validity); - } - - public function clearValidity() - { - unset($this->validity); - } - - /** - * Read-only description of how the alert policy is invalid. OK if the alert - * policy is valid. If not OK, the alert policy will not generate incidents. - * - * Generated from protobuf field .google.rpc.Status validity = 18; - * @param \Google\Rpc\Status $var - * @return $this - */ - public function setValidity($var) - { - GPBUtil::checkMessage($var, \Google\Rpc\Status::class); - $this->validity = $var; - - return $this; - } - - /** - * Identifies the notification channels to which notifications should be sent - * when incidents are opened or closed or when new violations occur on - * an already opened incident. Each element of this array corresponds to - * the `name` field in each of the - * [`NotificationChannel`][google.monitoring.v3.NotificationChannel] - * objects that are returned from the [`ListNotificationChannels`] - * [google.monitoring.v3.NotificationChannelService.ListNotificationChannels] - * method. The format of the entries in this field is: - * projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] - * - * Generated from protobuf field repeated string notification_channels = 14; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getNotificationChannels() - { - return $this->notification_channels; - } - - /** - * Identifies the notification channels to which notifications should be sent - * when incidents are opened or closed or when new violations occur on - * an already opened incident. Each element of this array corresponds to - * the `name` field in each of the - * [`NotificationChannel`][google.monitoring.v3.NotificationChannel] - * objects that are returned from the [`ListNotificationChannels`] - * [google.monitoring.v3.NotificationChannelService.ListNotificationChannels] - * method. The format of the entries in this field is: - * projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] - * - * Generated from protobuf field repeated string notification_channels = 14; - * @param string[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setNotificationChannels($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->notification_channels = $arr; - - return $this; - } - - /** - * A read-only record of the creation of the alerting policy. If provided - * in a call to create or update, this field will be ignored. - * - * Generated from protobuf field .google.monitoring.v3.MutationRecord creation_record = 10; - * @return \Google\Cloud\Monitoring\V3\MutationRecord|null - */ - public function getCreationRecord() - { - return $this->creation_record; - } - - public function hasCreationRecord() - { - return isset($this->creation_record); - } - - public function clearCreationRecord() - { - unset($this->creation_record); - } - - /** - * A read-only record of the creation of the alerting policy. If provided - * in a call to create or update, this field will be ignored. - * - * Generated from protobuf field .google.monitoring.v3.MutationRecord creation_record = 10; - * @param \Google\Cloud\Monitoring\V3\MutationRecord $var - * @return $this - */ - public function setCreationRecord($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\MutationRecord::class); - $this->creation_record = $var; - - return $this; - } - - /** - * A read-only record of the most recent change to the alerting policy. If - * provided in a call to create or update, this field will be ignored. - * - * Generated from protobuf field .google.monitoring.v3.MutationRecord mutation_record = 11; - * @return \Google\Cloud\Monitoring\V3\MutationRecord|null - */ - public function getMutationRecord() - { - return $this->mutation_record; - } - - public function hasMutationRecord() - { - return isset($this->mutation_record); - } - - public function clearMutationRecord() - { - unset($this->mutation_record); - } - - /** - * A read-only record of the most recent change to the alerting policy. If - * provided in a call to create or update, this field will be ignored. - * - * Generated from protobuf field .google.monitoring.v3.MutationRecord mutation_record = 11; - * @param \Google\Cloud\Monitoring\V3\MutationRecord $var - * @return $this - */ - public function setMutationRecord($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\MutationRecord::class); - $this->mutation_record = $var; - - return $this; - } - - /** - * Control over how this alert policy's notification channels are notified. - * - * Generated from protobuf field .google.monitoring.v3.AlertPolicy.AlertStrategy alert_strategy = 21; - * @return \Google\Cloud\Monitoring\V3\AlertPolicy\AlertStrategy|null - */ - public function getAlertStrategy() - { - return $this->alert_strategy; - } - - public function hasAlertStrategy() - { - return isset($this->alert_strategy); - } - - public function clearAlertStrategy() - { - unset($this->alert_strategy); - } - - /** - * Control over how this alert policy's notification channels are notified. - * - * Generated from protobuf field .google.monitoring.v3.AlertPolicy.AlertStrategy alert_strategy = 21; - * @param \Google\Cloud\Monitoring\V3\AlertPolicy\AlertStrategy $var - * @return $this - */ - public function setAlertStrategy($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\AlertPolicy\AlertStrategy::class); - $this->alert_strategy = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition.php deleted file mode 100644 index 649b747bd1c..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition.php +++ /dev/null @@ -1,340 +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 Stackdriver Monitoring when the - * condition is created as part of a new or updated alerting policy. - * When calling the - * [alertPolicies.create][google.monitoring.v3.AlertPolicyService.CreateAlertPolicy] - * method, do not include the `name` field in the conditions of the - * requested alerting policy. Stackdriver Monitoring creates the - * condition identifiers and includes them in the new policy. - * When calling the - * [alertPolicies.update][google.monitoring.v3.AlertPolicyService.UpdateAlertPolicy] - * method to update a policy, including a condition `name` causes the - * existing condition to be updated. Conditions without names are added to - * the updated policy. Existing conditions are deleted if they are not - * updated. - * Best practice is to preserve `[CONDITION_ID]` if you make only small - * changes, such as those to condition thresholds, durations, or trigger - * values. Otherwise, treat the change as a new condition and let the - * existing condition be deleted. - * - * Generated from protobuf field string name = 12; - */ - protected $name = ''; - /** - * A short name or phrase used to identify the condition in dashboards, - * notifications, and incidents. To avoid confusion, don't use the same - * display name for multiple conditions in the same policy. - * - * Generated from protobuf field string display_name = 6; - */ - protected $display_name = ''; - protected $condition; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required if the condition exists. The unique resource name for this - * condition. Its format is: - * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID]/conditions/[CONDITION_ID] - * `[CONDITION_ID]` is assigned by Stackdriver Monitoring when the - * condition is created as part of a new or updated alerting policy. - * When calling the - * [alertPolicies.create][google.monitoring.v3.AlertPolicyService.CreateAlertPolicy] - * method, do not include the `name` field in the conditions of the - * requested alerting policy. Stackdriver Monitoring creates the - * condition identifiers and includes them in the new policy. - * When calling the - * [alertPolicies.update][google.monitoring.v3.AlertPolicyService.UpdateAlertPolicy] - * method to update a policy, including a condition `name` causes the - * existing condition to be updated. Conditions without names are added to - * the updated policy. Existing conditions are deleted if they are not - * updated. - * Best practice is to preserve `[CONDITION_ID]` if you make only small - * changes, such as those to condition thresholds, durations, or trigger - * values. Otherwise, treat the change as a new condition and let the - * existing condition be deleted. - * @type string $display_name - * A short name or phrase used to identify the condition in dashboards, - * notifications, and incidents. To avoid confusion, don't use the same - * display name for multiple conditions in the same policy. - * @type \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\MetricThreshold $condition_threshold - * A condition that compares a time series against a threshold. - * @type \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\MetricAbsence $condition_absent - * A condition that checks that a time series continues to - * receive new data points. - * @type \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\LogMatch $condition_matched_log - * A condition that checks for log messages matching given constraints. If - * set, no other conditions can be present. - * @type \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\MonitoringQueryLanguageCondition $condition_monitoring_query_language - * A condition that uses the Monitoring Query Language to define - * alerts. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\Alert::initOnce(); - parent::__construct($data); - } - - /** - * Required if the condition exists. The unique resource name for this - * condition. Its format is: - * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID]/conditions/[CONDITION_ID] - * `[CONDITION_ID]` is assigned by Stackdriver Monitoring when the - * condition is created as part of a new or updated alerting policy. - * When calling the - * [alertPolicies.create][google.monitoring.v3.AlertPolicyService.CreateAlertPolicy] - * method, do not include the `name` field in the conditions of the - * requested alerting policy. Stackdriver Monitoring creates the - * condition identifiers and includes them in the new policy. - * When calling the - * [alertPolicies.update][google.monitoring.v3.AlertPolicyService.UpdateAlertPolicy] - * method to update a policy, including a condition `name` causes the - * existing condition to be updated. Conditions without names are added to - * the updated policy. Existing conditions are deleted if they are not - * updated. - * Best practice is to preserve `[CONDITION_ID]` if you make only small - * changes, such as those to condition thresholds, durations, or trigger - * values. Otherwise, treat the change as a new condition and let the - * existing condition be deleted. - * - * Generated from protobuf field string name = 12; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required if the condition exists. The unique resource name for this - * condition. Its format is: - * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID]/conditions/[CONDITION_ID] - * `[CONDITION_ID]` is assigned by Stackdriver Monitoring when the - * condition is created as part of a new or updated alerting policy. - * When calling the - * [alertPolicies.create][google.monitoring.v3.AlertPolicyService.CreateAlertPolicy] - * method, do not include the `name` field in the conditions of the - * requested alerting policy. Stackdriver Monitoring creates the - * condition identifiers and includes them in the new policy. - * When calling the - * [alertPolicies.update][google.monitoring.v3.AlertPolicyService.UpdateAlertPolicy] - * method to update a policy, including a condition `name` causes the - * existing condition to be updated. Conditions without names are added to - * the updated policy. Existing conditions are deleted if they are not - * updated. - * Best practice is to preserve `[CONDITION_ID]` if you make only small - * changes, such as those to condition thresholds, durations, or trigger - * values. Otherwise, treat the change as a new condition and let the - * existing condition be deleted. - * - * Generated from protobuf field string name = 12; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * A short name or phrase used to identify the condition in dashboards, - * notifications, and incidents. To avoid confusion, don't use the same - * display name for multiple conditions in the same policy. - * - * Generated from protobuf field string display_name = 6; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * A short name or phrase used to identify the condition in dashboards, - * notifications, and incidents. To avoid confusion, don't use the same - * display name for multiple conditions in the same policy. - * - * Generated from protobuf field string display_name = 6; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - - /** - * A condition that compares a time series against a threshold. - * - * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.MetricThreshold condition_threshold = 1; - * @return \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\MetricThreshold|null - */ - public function getConditionThreshold() - { - return $this->readOneof(1); - } - - public function hasConditionThreshold() - { - return $this->hasOneof(1); - } - - /** - * A condition that compares a time series against a threshold. - * - * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.MetricThreshold condition_threshold = 1; - * @param \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\MetricThreshold $var - * @return $this - */ - public function setConditionThreshold($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\MetricThreshold::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * A condition that checks that a time series continues to - * receive new data points. - * - * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.MetricAbsence condition_absent = 2; - * @return \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\MetricAbsence|null - */ - public function getConditionAbsent() - { - return $this->readOneof(2); - } - - public function hasConditionAbsent() - { - return $this->hasOneof(2); - } - - /** - * A condition that checks that a time series continues to - * receive new data points. - * - * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.MetricAbsence condition_absent = 2; - * @param \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\MetricAbsence $var - * @return $this - */ - public function setConditionAbsent($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\MetricAbsence::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * A condition that checks for log messages matching given constraints. If - * set, no other conditions can be present. - * - * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.LogMatch condition_matched_log = 20; - * @return \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\LogMatch|null - */ - public function getConditionMatchedLog() - { - return $this->readOneof(20); - } - - public function hasConditionMatchedLog() - { - return $this->hasOneof(20); - } - - /** - * A condition that checks for log messages matching given constraints. If - * set, no other conditions can be present. - * - * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.LogMatch condition_matched_log = 20; - * @param \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\LogMatch $var - * @return $this - */ - public function setConditionMatchedLog($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\LogMatch::class); - $this->writeOneof(20, $var); - - return $this; - } - - /** - * A condition that uses the Monitoring Query Language to define - * alerts. - * - * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition condition_monitoring_query_language = 19; - * @return \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\MonitoringQueryLanguageCondition|null - */ - public function getConditionMonitoringQueryLanguage() - { - return $this->readOneof(19); - } - - public function hasConditionMonitoringQueryLanguage() - { - return $this->hasOneof(19); - } - - /** - * A condition that uses the Monitoring Query Language to define - * alerts. - * - * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition condition_monitoring_query_language = 19; - * @param \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\MonitoringQueryLanguageCondition $var - * @return $this - */ - public function setConditionMonitoringQueryLanguage($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\MonitoringQueryLanguageCondition::class); - $this->writeOneof(19, $var); - - return $this; - } - - /** - * @return string - */ - public function getCondition() - { - return $this->whichOneof("condition"); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Condition::class, \Google\Cloud\Monitoring\V3\AlertPolicy_Condition::class); - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/MetricAbsence.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/MetricAbsence.php deleted file mode 100644 index 8c6bdbe75da..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/MetricAbsence.php +++ /dev/null @@ -1,300 +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 \Google\Cloud\Monitoring\V3\Aggregation[]|\Google\Protobuf\Internal\RepeatedField $aggregations - * Specifies the alignment of data points in individual time series as - * well as how to combine the retrieved time series together (such as - * when aggregating multiple streams on each resource to a single - * stream for each resource or when aggregating streams across all - * members of a group of resources). Multiple aggregations - * are applied in the order specified. - * This field is similar to the one in the [`ListTimeSeries` - * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). - * It is advisable to use the `ListTimeSeries` method when debugging this - * field. - * @type \Google\Protobuf\Duration $duration - * The amount of time that a time series must fail to report new - * data to be considered failing. The minimum value of this field - * is 120 seconds. Larger values that are a multiple of a - * minute--for example, 240 or 300 seconds--are supported. - * If an invalid value is given, an - * error will be returned. The `Duration.nanos` field is - * ignored. - * @type \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\Trigger $trigger - * The number/percent of time series for which the comparison must hold - * in order for the condition to trigger. If unspecified, then the - * condition will trigger if the comparison is true for any of the - * time series that have been identified by `filter` and `aggregations`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\Alert::initOnce(); - parent::__construct($data); - } - - /** - * Required. A [filter](https://cloud.google.com/monitoring/api/v3/filters) that - * identifies which time series should be compared with the threshold. - * The filter is similar to the one that is specified in the - * [`ListTimeSeries` - * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list) - * (that call is useful to verify the time series that will be retrieved / - * processed). The filter must specify the metric type and the resource - * type. Optionally, it can specify resource labels and metric labels. - * This field must not exceed 2048 Unicode characters in length. - * - * Generated from protobuf field string filter = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Required. A [filter](https://cloud.google.com/monitoring/api/v3/filters) that - * identifies which time series should be compared with the threshold. - * The filter is similar to the one that is specified in the - * [`ListTimeSeries` - * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list) - * (that call is useful to verify the time series that will be retrieved / - * processed). The filter must specify the metric type and the resource - * type. Optionally, it can specify resource labels and metric labels. - * This field must not exceed 2048 Unicode characters in length. - * - * Generated from protobuf field string filter = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * Specifies the alignment of data points in individual time series as - * well as how to combine the retrieved time series together (such as - * when aggregating multiple streams on each resource to a single - * stream for each resource or when aggregating streams across all - * members of a group of resources). Multiple aggregations - * are applied in the order specified. - * This field is similar to the one in the [`ListTimeSeries` - * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). - * It is advisable to use the `ListTimeSeries` method when debugging this - * field. - * - * Generated from protobuf field repeated .google.monitoring.v3.Aggregation aggregations = 5; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getAggregations() - { - return $this->aggregations; - } - - /** - * Specifies the alignment of data points in individual time series as - * well as how to combine the retrieved time series together (such as - * when aggregating multiple streams on each resource to a single - * stream for each resource or when aggregating streams across all - * members of a group of resources). Multiple aggregations - * are applied in the order specified. - * This field is similar to the one in the [`ListTimeSeries` - * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). - * It is advisable to use the `ListTimeSeries` method when debugging this - * field. - * - * Generated from protobuf field repeated .google.monitoring.v3.Aggregation aggregations = 5; - * @param \Google\Cloud\Monitoring\V3\Aggregation[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setAggregations($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\Aggregation::class); - $this->aggregations = $arr; - - return $this; - } - - /** - * The amount of time that a time series must fail to report new - * data to be considered failing. The minimum value of this field - * is 120 seconds. Larger values that are a multiple of a - * minute--for example, 240 or 300 seconds--are supported. - * If an invalid value is given, an - * error will be returned. The `Duration.nanos` field is - * ignored. - * - * Generated from protobuf field .google.protobuf.Duration duration = 2; - * @return \Google\Protobuf\Duration|null - */ - public function getDuration() - { - return $this->duration; - } - - public function hasDuration() - { - return isset($this->duration); - } - - public function clearDuration() - { - unset($this->duration); - } - - /** - * The amount of time that a time series must fail to report new - * data to be considered failing. The minimum value of this field - * is 120 seconds. Larger values that are a multiple of a - * minute--for example, 240 or 300 seconds--are supported. - * If an invalid value is given, an - * error will be returned. The `Duration.nanos` field is - * ignored. - * - * Generated from protobuf field .google.protobuf.Duration duration = 2; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setDuration($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->duration = $var; - - return $this; - } - - /** - * The number/percent of time series for which the comparison must hold - * in order for the condition to trigger. If unspecified, then the - * condition will trigger if the comparison is true for any of the - * time series that have been identified by `filter` and `aggregations`. - * - * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; - * @return \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\Trigger|null - */ - public function getTrigger() - { - return $this->trigger; - } - - public function hasTrigger() - { - return isset($this->trigger); - } - - public function clearTrigger() - { - unset($this->trigger); - } - - /** - * The number/percent of time series for which the comparison must hold - * in order for the condition to trigger. If unspecified, then the - * condition will trigger if the comparison is true for any of the - * time series that have been identified by `filter` and `aggregations`. - * - * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 3; - * @param \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\Trigger $var - * @return $this - */ - public function setTrigger($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\Trigger::class); - $this->trigger = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(MetricAbsence::class, \Google\Cloud\Monitoring\V3\AlertPolicy_Condition_MetricAbsence::class); - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/MetricThreshold.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/MetricThreshold.php deleted file mode 100644 index 17b7e07997e..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/MetricThreshold.php +++ /dev/null @@ -1,529 +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; - /** - * The comparison to apply between the time series (indicated by `filter` - * and `aggregation`) and the threshold (indicated by `threshold_value`). - * The comparison is applied on each time series, with the time series - * on the left-hand side and the threshold on the right-hand side. - * Only `COMPARISON_LT` and `COMPARISON_GT` are supported currently. - * - * Generated from protobuf field .google.monitoring.v3.ComparisonType comparison = 4; - */ - protected $comparison = 0; - /** - * A value against which to compare the time series. - * - * Generated from protobuf field double threshold_value = 5; - */ - protected $threshold_value = 0.0; - /** - * The amount of time that a time series must violate the - * threshold to be considered failing. Currently, only values - * that are a multiple of a minute--e.g., 0, 60, 120, or 300 - * seconds--are supported. If an invalid value is given, an - * error will be returned. When choosing a duration, it is useful to - * keep in mind the frequency of the underlying time series data - * (which may also be affected by any alignments specified in the - * `aggregations` field); a good duration is long enough so that a single - * outlier does not generate spurious alerts, but short enough that - * unhealthy states are detected and alerted on quickly. - * - * Generated from protobuf field .google.protobuf.Duration duration = 6; - */ - protected $duration = null; - /** - * The number/percent of time series for which the comparison must hold - * in order for the condition to trigger. If unspecified, then the - * condition will trigger if the comparison is true for any of the - * time series that have been identified by `filter` and `aggregations`, - * or by the ratio, if `denominator_filter` and `denominator_aggregations` - * are specified. - * - * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 7; - */ - protected $trigger = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $filter - * Required. A [filter](https://cloud.google.com/monitoring/api/v3/filters) that - * identifies which time series should be compared with the threshold. - * The filter is similar to the one that is specified in the - * [`ListTimeSeries` - * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list) - * (that call is useful to verify the time series that will be retrieved / - * processed). The filter must specify the metric type and the resource - * type. Optionally, it can specify resource labels and metric labels. - * This field must not exceed 2048 Unicode characters in length. - * @type \Google\Cloud\Monitoring\V3\Aggregation[]|\Google\Protobuf\Internal\RepeatedField $aggregations - * Specifies the alignment of data points in individual time series as - * well as how to combine the retrieved time series together (such as - * when aggregating multiple streams on each resource to a single - * stream for each resource or when aggregating streams across all - * members of a group of resources). Multiple aggregations - * are applied in the order specified. - * This field is similar to the one in the [`ListTimeSeries` - * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). - * It is advisable to use the `ListTimeSeries` method when debugging this - * field. - * @type string $denominator_filter - * A [filter](https://cloud.google.com/monitoring/api/v3/filters) that - * identifies a time series that should be used as the denominator of a - * ratio that will be compared with the threshold. If a - * `denominator_filter` is specified, the time series specified by the - * `filter` field will be used as the numerator. - * The filter must specify the metric type and optionally may contain - * restrictions on resource type, resource labels, and metric labels. - * This field may not exceed 2048 Unicode characters in length. - * @type \Google\Cloud\Monitoring\V3\Aggregation[]|\Google\Protobuf\Internal\RepeatedField $denominator_aggregations - * Specifies the alignment of data points in individual time series - * selected by `denominatorFilter` as - * well as how to combine the retrieved time series together (such as - * when aggregating multiple streams on each resource to a single - * stream for each resource or when aggregating streams across all - * members of a group of resources). - * When computing ratios, the `aggregations` and - * `denominator_aggregations` fields must use the same alignment period - * and produce time series that have the same periodicity and labels. - * @type int $comparison - * The comparison to apply between the time series (indicated by `filter` - * and `aggregation`) and the threshold (indicated by `threshold_value`). - * The comparison is applied on each time series, with the time series - * on the left-hand side and the threshold on the right-hand side. - * Only `COMPARISON_LT` and `COMPARISON_GT` are supported currently. - * @type float $threshold_value - * A value against which to compare the time series. - * @type \Google\Protobuf\Duration $duration - * The amount of time that a time series must violate the - * threshold to be considered failing. Currently, only values - * that are a multiple of a minute--e.g., 0, 60, 120, or 300 - * seconds--are supported. If an invalid value is given, an - * error will be returned. When choosing a duration, it is useful to - * keep in mind the frequency of the underlying time series data - * (which may also be affected by any alignments specified in the - * `aggregations` field); a good duration is long enough so that a single - * outlier does not generate spurious alerts, but short enough that - * unhealthy states are detected and alerted on quickly. - * @type \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\Trigger $trigger - * The number/percent of time series for which the comparison must hold - * in order for the condition to trigger. If unspecified, then the - * condition will trigger if the comparison is true for any of the - * time series that have been identified by `filter` and `aggregations`, - * or by the ratio, if `denominator_filter` and `denominator_aggregations` - * are specified. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\Alert::initOnce(); - parent::__construct($data); - } - - /** - * Required. A [filter](https://cloud.google.com/monitoring/api/v3/filters) that - * identifies which time series should be compared with the threshold. - * The filter is similar to the one that is specified in the - * [`ListTimeSeries` - * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list) - * (that call is useful to verify the time series that will be retrieved / - * processed). The filter must specify the metric type and the resource - * type. Optionally, it can specify resource labels and metric labels. - * This field must not exceed 2048 Unicode characters in length. - * - * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Required. A [filter](https://cloud.google.com/monitoring/api/v3/filters) that - * identifies which time series should be compared with the threshold. - * The filter is similar to the one that is specified in the - * [`ListTimeSeries` - * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list) - * (that call is useful to verify the time series that will be retrieved / - * processed). The filter must specify the metric type and the resource - * type. Optionally, it can specify resource labels and metric labels. - * This field must not exceed 2048 Unicode characters in length. - * - * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * Specifies the alignment of data points in individual time series as - * well as how to combine the retrieved time series together (such as - * when aggregating multiple streams on each resource to a single - * stream for each resource or when aggregating streams across all - * members of a group of resources). Multiple aggregations - * are applied in the order specified. - * This field is similar to the one in the [`ListTimeSeries` - * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). - * It is advisable to use the `ListTimeSeries` method when debugging this - * field. - * - * Generated from protobuf field repeated .google.monitoring.v3.Aggregation aggregations = 8; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getAggregations() - { - return $this->aggregations; - } - - /** - * Specifies the alignment of data points in individual time series as - * well as how to combine the retrieved time series together (such as - * when aggregating multiple streams on each resource to a single - * stream for each resource or when aggregating streams across all - * members of a group of resources). Multiple aggregations - * are applied in the order specified. - * This field is similar to the one in the [`ListTimeSeries` - * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). - * It is advisable to use the `ListTimeSeries` method when debugging this - * field. - * - * Generated from protobuf field repeated .google.monitoring.v3.Aggregation aggregations = 8; - * @param \Google\Cloud\Monitoring\V3\Aggregation[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setAggregations($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\Aggregation::class); - $this->aggregations = $arr; - - return $this; - } - - /** - * A [filter](https://cloud.google.com/monitoring/api/v3/filters) that - * identifies a time series that should be used as the denominator of a - * ratio that will be compared with the threshold. If a - * `denominator_filter` is specified, the time series specified by the - * `filter` field will be used as the numerator. - * The filter must specify the metric type and optionally may contain - * restrictions on resource type, resource labels, and metric labels. - * This field may not exceed 2048 Unicode characters in length. - * - * Generated from protobuf field string denominator_filter = 9; - * @return string - */ - public function getDenominatorFilter() - { - return $this->denominator_filter; - } - - /** - * A [filter](https://cloud.google.com/monitoring/api/v3/filters) that - * identifies a time series that should be used as the denominator of a - * ratio that will be compared with the threshold. If a - * `denominator_filter` is specified, the time series specified by the - * `filter` field will be used as the numerator. - * The filter must specify the metric type and optionally may contain - * restrictions on resource type, resource labels, and metric labels. - * This field may not exceed 2048 Unicode characters in length. - * - * Generated from protobuf field string denominator_filter = 9; - * @param string $var - * @return $this - */ - public function setDenominatorFilter($var) - { - GPBUtil::checkString($var, True); - $this->denominator_filter = $var; - - return $this; - } - - /** - * Specifies the alignment of data points in individual time series - * selected by `denominatorFilter` as - * well as how to combine the retrieved time series together (such as - * when aggregating multiple streams on each resource to a single - * stream for each resource or when aggregating streams across all - * members of a group of resources). - * When computing ratios, the `aggregations` and - * `denominator_aggregations` fields must use the same alignment period - * and produce time series that have the same periodicity and labels. - * - * Generated from protobuf field repeated .google.monitoring.v3.Aggregation denominator_aggregations = 10; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getDenominatorAggregations() - { - return $this->denominator_aggregations; - } - - /** - * Specifies the alignment of data points in individual time series - * selected by `denominatorFilter` as - * well as how to combine the retrieved time series together (such as - * when aggregating multiple streams on each resource to a single - * stream for each resource or when aggregating streams across all - * members of a group of resources). - * When computing ratios, the `aggregations` and - * `denominator_aggregations` fields must use the same alignment period - * and produce time series that have the same periodicity and labels. - * - * Generated from protobuf field repeated .google.monitoring.v3.Aggregation denominator_aggregations = 10; - * @param \Google\Cloud\Monitoring\V3\Aggregation[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setDenominatorAggregations($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\Aggregation::class); - $this->denominator_aggregations = $arr; - - return $this; - } - - /** - * The comparison to apply between the time series (indicated by `filter` - * and `aggregation`) and the threshold (indicated by `threshold_value`). - * The comparison is applied on each time series, with the time series - * on the left-hand side and the threshold on the right-hand side. - * Only `COMPARISON_LT` and `COMPARISON_GT` are supported currently. - * - * Generated from protobuf field .google.monitoring.v3.ComparisonType comparison = 4; - * @return int - */ - public function getComparison() - { - return $this->comparison; - } - - /** - * The comparison to apply between the time series (indicated by `filter` - * and `aggregation`) and the threshold (indicated by `threshold_value`). - * The comparison is applied on each time series, with the time series - * on the left-hand side and the threshold on the right-hand side. - * Only `COMPARISON_LT` and `COMPARISON_GT` are supported currently. - * - * Generated from protobuf field .google.monitoring.v3.ComparisonType comparison = 4; - * @param int $var - * @return $this - */ - public function setComparison($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\ComparisonType::class); - $this->comparison = $var; - - return $this; - } - - /** - * A value against which to compare the time series. - * - * Generated from protobuf field double threshold_value = 5; - * @return float - */ - public function getThresholdValue() - { - return $this->threshold_value; - } - - /** - * A value against which to compare the time series. - * - * Generated from protobuf field double threshold_value = 5; - * @param float $var - * @return $this - */ - public function setThresholdValue($var) - { - GPBUtil::checkDouble($var); - $this->threshold_value = $var; - - return $this; - } - - /** - * The amount of time that a time series must violate the - * threshold to be considered failing. Currently, only values - * that are a multiple of a minute--e.g., 0, 60, 120, or 300 - * seconds--are supported. If an invalid value is given, an - * error will be returned. When choosing a duration, it is useful to - * keep in mind the frequency of the underlying time series data - * (which may also be affected by any alignments specified in the - * `aggregations` field); a good duration is long enough so that a single - * outlier does not generate spurious alerts, but short enough that - * unhealthy states are detected and alerted on quickly. - * - * Generated from protobuf field .google.protobuf.Duration duration = 6; - * @return \Google\Protobuf\Duration|null - */ - public function getDuration() - { - return $this->duration; - } - - public function hasDuration() - { - return isset($this->duration); - } - - public function clearDuration() - { - unset($this->duration); - } - - /** - * The amount of time that a time series must violate the - * threshold to be considered failing. Currently, only values - * that are a multiple of a minute--e.g., 0, 60, 120, or 300 - * seconds--are supported. If an invalid value is given, an - * error will be returned. When choosing a duration, it is useful to - * keep in mind the frequency of the underlying time series data - * (which may also be affected by any alignments specified in the - * `aggregations` field); a good duration is long enough so that a single - * outlier does not generate spurious alerts, but short enough that - * unhealthy states are detected and alerted on quickly. - * - * Generated from protobuf field .google.protobuf.Duration duration = 6; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setDuration($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->duration = $var; - - return $this; - } - - /** - * The number/percent of time series for which the comparison must hold - * in order for the condition to trigger. If unspecified, then the - * condition will trigger if the comparison is true for any of the - * time series that have been identified by `filter` and `aggregations`, - * or by the ratio, if `denominator_filter` and `denominator_aggregations` - * are specified. - * - * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 7; - * @return \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\Trigger|null - */ - public function getTrigger() - { - return $this->trigger; - } - - public function hasTrigger() - { - return isset($this->trigger); - } - - public function clearTrigger() - { - unset($this->trigger); - } - - /** - * The number/percent of time series for which the comparison must hold - * in order for the condition to trigger. If unspecified, then the - * condition will trigger if the comparison is true for any of the - * time series that have been identified by `filter` and `aggregations`, - * or by the ratio, if `denominator_filter` and `denominator_aggregations` - * are specified. - * - * Generated from protobuf field .google.monitoring.v3.AlertPolicy.Condition.Trigger trigger = 7; - * @param \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\Trigger $var - * @return $this - */ - public function setTrigger($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\AlertPolicy\Condition\Trigger::class); - $this->trigger = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(MetricThreshold::class, \Google\Cloud\Monitoring\V3\AlertPolicy_Condition_MetricThreshold::class); - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Condition/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 e5ef69156da..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/ConditionCombinerType.php +++ /dev/null @@ -1,77 +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 => 'PBAND', - self::PBOR => 'PBOR', - self::AND_WITH_MATCHING_RESOURCE => 'AND_WITH_MATCHING_RESOURCE', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ConditionCombinerType::class, \Google\Cloud\Monitoring\V3\AlertPolicy_ConditionCombinerType::class); - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Documentation.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Documentation.php deleted file mode 100644 index 318234b3eeb..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy/Documentation.php +++ /dev/null @@ -1,125 +0,0 @@ -google.monitoring.v3.AlertPolicy.Documentation - */ -class Documentation extends \Google\Protobuf\Internal\Message -{ - /** - * The text of the documentation, interpreted according to `mime_type`. - * The content may not exceed 8,192 Unicode characters and may not exceed - * more than 10,240 bytes when encoded in UTF-8 format, whichever is - * smaller. - * - * Generated from protobuf field string content = 1; - */ - protected $content = ''; - /** - * The format of the `content` field. Presently, only the value - * `"text/markdown"` is supported. See - * [Markdown](https://en.wikipedia.org/wiki/Markdown) for more information. - * - * Generated from protobuf field string mime_type = 2; - */ - protected $mime_type = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $content - * The text of the documentation, interpreted according to `mime_type`. - * The content may not exceed 8,192 Unicode characters and may not exceed - * more than 10,240 bytes when encoded in UTF-8 format, whichever is - * smaller. - * @type string $mime_type - * The format of the `content` field. Presently, only the value - * `"text/markdown"` is supported. See - * [Markdown](https://en.wikipedia.org/wiki/Markdown) for more information. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\Alert::initOnce(); - parent::__construct($data); - } - - /** - * The text of the documentation, interpreted according to `mime_type`. - * The content may not exceed 8,192 Unicode characters and may not exceed - * more than 10,240 bytes when encoded in UTF-8 format, whichever is - * smaller. - * - * Generated from protobuf field string content = 1; - * @return string - */ - public function getContent() - { - return $this->content; - } - - /** - * The text of the documentation, interpreted according to `mime_type`. - * The content may not exceed 8,192 Unicode characters and may not exceed - * more than 10,240 bytes when encoded in UTF-8 format, whichever is - * smaller. - * - * Generated from protobuf field string content = 1; - * @param string $var - * @return $this - */ - public function setContent($var) - { - GPBUtil::checkString($var, True); - $this->content = $var; - - return $this; - } - - /** - * The format of the `content` field. Presently, only the value - * `"text/markdown"` is supported. See - * [Markdown](https://en.wikipedia.org/wiki/Markdown) for more information. - * - * Generated from protobuf field string mime_type = 2; - * @return string - */ - public function getMimeType() - { - return $this->mime_type; - } - - /** - * The format of the `content` field. Presently, only the value - * `"text/markdown"` is supported. See - * [Markdown](https://en.wikipedia.org/wiki/Markdown) for more information. - * - * Generated from protobuf field string mime_type = 2; - * @param string $var - * @return $this - */ - public function setMimeType($var) - { - GPBUtil::checkString($var, True); - $this->mime_type = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Documentation::class, \Google\Cloud\Monitoring\V3\AlertPolicy_Documentation::class); - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicyServiceGrpcClient.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicyServiceGrpcClient.php deleted file mode 100644 index d6f646e9452..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicyServiceGrpcClient.php +++ /dev/null @@ -1,121 +0,0 @@ -_simpleRequest('/google.monitoring.v3.AlertPolicyService/ListAlertPolicies', - $argument, - ['\Google\Cloud\Monitoring\V3\ListAlertPoliciesResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets a single alerting policy. - * @param \Google\Cloud\Monitoring\V3\GetAlertPolicyRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetAlertPolicy(\Google\Cloud\Monitoring\V3\GetAlertPolicyRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.monitoring.v3.AlertPolicyService/GetAlertPolicy', - $argument, - ['\Google\Cloud\Monitoring\V3\AlertPolicy', 'decode'], - $metadata, $options); - } - - /** - * Creates a new alerting policy. - * @param \Google\Cloud\Monitoring\V3\CreateAlertPolicyRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateAlertPolicy(\Google\Cloud\Monitoring\V3\CreateAlertPolicyRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.monitoring.v3.AlertPolicyService/CreateAlertPolicy', - $argument, - ['\Google\Cloud\Monitoring\V3\AlertPolicy', 'decode'], - $metadata, $options); - } - - /** - * Deletes an alerting policy. - * @param \Google\Cloud\Monitoring\V3\DeleteAlertPolicyRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteAlertPolicy(\Google\Cloud\Monitoring\V3\DeleteAlertPolicyRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.monitoring.v3.AlertPolicyService/DeleteAlertPolicy', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - - /** - * Updates an alerting policy. You can either replace the entire policy with - * a new one or replace only certain fields in the current alerting policy by - * specifying the fields to be updated via `updateMask`. Returns the - * updated alerting policy. - * @param \Google\Cloud\Monitoring\V3\UpdateAlertPolicyRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateAlertPolicy(\Google\Cloud\Monitoring\V3\UpdateAlertPolicyRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.monitoring.v3.AlertPolicyService/UpdateAlertPolicy', - $argument, - ['\Google\Cloud\Monitoring\V3\AlertPolicy', 'decode'], - $metadata, $options); - } - -} diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy_Condition.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy_Condition.php deleted file mode 100644 index f0133eeb327..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/AlertPolicy_Condition.php +++ /dev/null @@ -1,16 +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 string[]|\Google\Protobuf\Internal\RepeatedField $method - * OPTIONAL: The set of RPCs to which this SLI is relevant. Telemetry from - * other methods will not be used to calculate performance for this SLI. If - * omitted, this SLI applies to all the Service's methods. For service types - * that don't support breaking down by method, setting this field will result - * in an error. - * @type string[]|\Google\Protobuf\Internal\RepeatedField $location - * OPTIONAL: The set of locations to which this SLI is relevant. Telemetry - * from other locations will not be used to calculate performance for this - * SLI. If omitted, this SLI applies to all locations in which the Service has - * activity. For service types that don't support breaking down by location, - * setting this field will result in an error. - * @type string[]|\Google\Protobuf\Internal\RepeatedField $version - * OPTIONAL: The set of API versions to which this SLI is relevant. Telemetry - * from other API versions will not be used to calculate performance for this - * SLI. If omitted, this SLI applies to all API versions. For service types - * that don't support breaking down by version, setting this field will result - * in an error. - * @type \Google\Cloud\Monitoring\V3\BasicSli\AvailabilityCriteria $availability - * Good service is defined to be the count of requests made to this service - * that return successfully. - * @type \Google\Cloud\Monitoring\V3\BasicSli\LatencyCriteria $latency - * Good service is defined to be the count of requests made to this service - * that are fast enough with respect to `latency.threshold`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\Service::initOnce(); - parent::__construct($data); - } - - /** - * OPTIONAL: The set of RPCs to which this SLI is relevant. Telemetry from - * other methods will not be used to calculate performance for this SLI. If - * omitted, this SLI applies to all the Service's methods. For service types - * that don't support breaking down by method, setting this field will result - * in an error. - * - * Generated from protobuf field repeated string method = 7; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getMethod() - { - return $this->method; - } - - /** - * OPTIONAL: The set of RPCs to which this SLI is relevant. Telemetry from - * other methods will not be used to calculate performance for this SLI. If - * omitted, this SLI applies to all the Service's methods. For service types - * that don't support breaking down by method, setting this field will result - * in an error. - * - * Generated from protobuf field repeated string method = 7; - * @param string[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setMethod($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->method = $arr; - - return $this; - } - - /** - * OPTIONAL: The set of locations to which this SLI is relevant. Telemetry - * from other locations will not be used to calculate performance for this - * SLI. If omitted, this SLI applies to all locations in which the Service has - * activity. For service types that don't support breaking down by location, - * setting this field will result in an error. - * - * Generated from protobuf field repeated string location = 8; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getLocation() - { - return $this->location; - } - - /** - * OPTIONAL: The set of locations to which this SLI is relevant. Telemetry - * from other locations will not be used to calculate performance for this - * SLI. If omitted, this SLI applies to all locations in which the Service has - * activity. For service types that don't support breaking down by location, - * setting this field will result in an error. - * - * Generated from protobuf field repeated string location = 8; - * @param string[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setLocation($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->location = $arr; - - return $this; - } - - /** - * OPTIONAL: The set of API versions to which this SLI is relevant. Telemetry - * from other API versions will not be used to calculate performance for this - * SLI. If omitted, this SLI applies to all API versions. For service types - * that don't support breaking down by version, setting this field will result - * in an error. - * - * Generated from protobuf field repeated string version = 9; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getVersion() - { - return $this->version; - } - - /** - * OPTIONAL: The set of API versions to which this SLI is relevant. Telemetry - * from other API versions will not be used to calculate performance for this - * SLI. If omitted, this SLI applies to all API versions. For service types - * that don't support breaking down by version, setting this field will result - * in an error. - * - * Generated from protobuf field repeated string version = 9; - * @param string[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setVersion($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->version = $arr; - - return $this; - } - - /** - * Good service is defined to be the count of requests made to this service - * that return successfully. - * - * Generated from protobuf field .google.monitoring.v3.BasicSli.AvailabilityCriteria availability = 2; - * @return \Google\Cloud\Monitoring\V3\BasicSli\AvailabilityCriteria|null - */ - public function getAvailability() - { - return $this->readOneof(2); - } - - public function hasAvailability() - { - return $this->hasOneof(2); - } - - /** - * Good service is defined to be the count of requests made to this service - * that return successfully. - * - * Generated from protobuf field .google.monitoring.v3.BasicSli.AvailabilityCriteria availability = 2; - * @param \Google\Cloud\Monitoring\V3\BasicSli\AvailabilityCriteria $var - * @return $this - */ - public function setAvailability($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\BasicSli\AvailabilityCriteria::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * Good service is defined to be the count of requests made to this service - * that are fast enough with respect to `latency.threshold`. - * - * Generated from protobuf field .google.monitoring.v3.BasicSli.LatencyCriteria latency = 3; - * @return \Google\Cloud\Monitoring\V3\BasicSli\LatencyCriteria|null - */ - public function getLatency() - { - return $this->readOneof(3); - } - - public function hasLatency() - { - return $this->hasOneof(3); - } - - /** - * Good service is defined to be the count of requests made to this service - * that are fast enough with respect to `latency.threshold`. - * - * Generated from protobuf field .google.monitoring.v3.BasicSli.LatencyCriteria latency = 3; - * @param \Google\Cloud\Monitoring\V3\BasicSli\LatencyCriteria $var - * @return $this - */ - public function setLatency($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\BasicSli\LatencyCriteria::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * @return string - */ - public function getSliCriteria() - { - return $this->whichOneof("sli_criteria"); - } - -} - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/BasicSli/AvailabilityCriteria.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/BasicSli/AvailabilityCriteria.php 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/BasicSli_AvailabilityCriteria.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/BasicSli_AvailabilityCriteria.php deleted file mode 100644 index c03c272583e..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/BasicSli_AvailabilityCriteria.php +++ /dev/null @@ -1,16 +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 c0095e61d9a..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateAlertPolicyRequest.php +++ /dev/null @@ -1,155 +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 workspace, otherwise INVALID_ARGUMENT error will - * return. The alerting policy that is returned will have a name that contains - * a normalized representation of this name as a prefix but adds a suffix of - * the form `/alertPolicies/[ALERT_POLICY_ID]`, identifying the policy in the - * container. - * - * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Required. The requested alerting policy. You should omit the `name` field in this - * policy. The name will be returned in the new policy, including - * a new `[ALERT_POLICY_ID]` value. - * - * Generated from protobuf field .google.monitoring.v3.AlertPolicy alert_policy = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $alert_policy = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) in - * which to create the alerting policy. The format is: - * projects/[PROJECT_ID_OR_NUMBER] - * Note that this field names the parent container in which the alerting - * policy will be written, not the name of the created policy. |name| must be - * a host project of a workspace, otherwise INVALID_ARGUMENT error will - * return. The alerting policy that is returned will have a name that contains - * a normalized representation of this name as a prefix but adds a suffix of - * the form `/alertPolicies/[ALERT_POLICY_ID]`, identifying the policy in the - * container. - * @type \Google\Cloud\Monitoring\V3\AlertPolicy $alert_policy - * Required. The requested alerting policy. You should omit the `name` field in this - * policy. The name will be returned in the new policy, including - * a new `[ALERT_POLICY_ID]` value. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\AlertService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) in - * which to create the alerting policy. The format is: - * projects/[PROJECT_ID_OR_NUMBER] - * Note that this field names the parent container in which the alerting - * policy will be written, not the name of the created policy. |name| must be - * a host project of a workspace, otherwise INVALID_ARGUMENT error will - * return. The alerting policy that is returned will have a name that contains - * a normalized representation of this name as a prefix but adds a suffix of - * the form `/alertPolicies/[ALERT_POLICY_ID]`, identifying the policy in the - * container. - * - * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) in - * which to create the alerting policy. The format is: - * projects/[PROJECT_ID_OR_NUMBER] - * Note that this field names the parent container in which the alerting - * policy will be written, not the name of the created policy. |name| must be - * a host project of a workspace, otherwise INVALID_ARGUMENT error will - * return. The alerting policy that is returned will have a name that contains - * a normalized representation of this name as a prefix but adds a suffix of - * the form `/alertPolicies/[ALERT_POLICY_ID]`, identifying the policy in the - * container. - * - * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Required. The requested alerting policy. You should omit the `name` field in this - * policy. The name will be returned in the new policy, including - * a new `[ALERT_POLICY_ID]` value. - * - * Generated from protobuf field .google.monitoring.v3.AlertPolicy alert_policy = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Monitoring\V3\AlertPolicy|null - */ - public function getAlertPolicy() - { - return $this->alert_policy; - } - - public function hasAlertPolicy() - { - return isset($this->alert_policy); - } - - public function clearAlertPolicy() - { - unset($this->alert_policy); - } - - /** - * Required. The requested alerting policy. You should omit the `name` field in this - * policy. The name will be returned in the new policy, including - * a new `[ALERT_POLICY_ID]` value. - * - * Generated from protobuf field .google.monitoring.v3.AlertPolicy alert_policy = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Monitoring\V3\AlertPolicy $var - * @return $this - */ - public function setAlertPolicy($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\AlertPolicy::class); - $this->alert_policy = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateGroupRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateGroupRequest.php deleted file mode 100644 index 5cfb0a4a94c..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateGroupRequest.php +++ /dev/null @@ -1,157 +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; - - /** - * 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 7ebf8e384c8..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateMetricDescriptorRequest.php +++ /dev/null @@ -1,127 +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; - - /** - * 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 6410588460c..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateNotificationChannelRequest.php +++ /dev/null @@ -1,135 +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; - - /** - * 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 8d3f20ef662..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateServiceLevelObjectiveRequest.php +++ /dev/null @@ -1,165 +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-z0-9\-]+` - * - * Generated from protobuf field string service_level_objective_id = 3; - */ - protected $service_level_objective_id = ''; - /** - * Required. The `ServiceLevelObjective` to create. - * The provided `name` will be respected if no `ServiceLevelObjective` exists - * with this name. - * - * Generated from protobuf field .google.monitoring.v3.ServiceLevelObjective service_level_objective = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $service_level_objective = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. Resource name of the parent `Service`. The format is: - * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] - * @type string $service_level_objective_id - * Optional. The ServiceLevelObjective id to use for this - * ServiceLevelObjective. If omitted, an id will be generated instead. Must - * match the pattern `[a-z0-9\-]+` - * @type \Google\Cloud\Monitoring\V3\ServiceLevelObjective $service_level_objective - * Required. The `ServiceLevelObjective` to create. - * The provided `name` will be respected if no `ServiceLevelObjective` exists - * with this name. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\ServiceService::initOnce(); - parent::__construct($data); - } - - /** - * Required. Resource name of the parent `Service`. The format is: - * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. Resource name of the parent `Service`. The format is: - * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Optional. The ServiceLevelObjective id to use for this - * ServiceLevelObjective. If omitted, an id will be generated instead. Must - * match the pattern `[a-z0-9\-]+` - * - * Generated from protobuf field string service_level_objective_id = 3; - * @return string - */ - public function getServiceLevelObjectiveId() - { - return $this->service_level_objective_id; - } - - /** - * Optional. The ServiceLevelObjective id to use for this - * ServiceLevelObjective. If omitted, an id will be generated instead. Must - * match the pattern `[a-z0-9\-]+` - * - * Generated from protobuf field string service_level_objective_id = 3; - * @param string $var - * @return $this - */ - public function setServiceLevelObjectiveId($var) - { - GPBUtil::checkString($var, True); - $this->service_level_objective_id = $var; - - return $this; - } - - /** - * Required. The `ServiceLevelObjective` to create. - * The provided `name` will be respected if no `ServiceLevelObjective` exists - * with this name. - * - * Generated from protobuf field .google.monitoring.v3.ServiceLevelObjective service_level_objective = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Monitoring\V3\ServiceLevelObjective|null - */ - public function getServiceLevelObjective() - { - return $this->service_level_objective; - } - - public function hasServiceLevelObjective() - { - return isset($this->service_level_objective); - } - - public function clearServiceLevelObjective() - { - unset($this->service_level_objective); - } - - /** - * Required. The `ServiceLevelObjective` to create. - * The provided `name` will be respected if no `ServiceLevelObjective` exists - * with this name. - * - * Generated from protobuf field .google.monitoring.v3.ServiceLevelObjective service_level_objective = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Monitoring\V3\ServiceLevelObjective $var - * @return $this - */ - public function setServiceLevelObjective($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\ServiceLevelObjective::class); - $this->service_level_objective = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateServiceRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateServiceRequest.php deleted file mode 100644 index ceefd3576a8..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateServiceRequest.php +++ /dev/null @@ -1,157 +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 workspace. The format is: - * projects/[PROJECT_ID_OR_NUMBER] - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Optional. The Service id to use for this Service. If omitted, an id will be - * generated instead. Must match the pattern `[a-z0-9\-]+` - * - * Generated from protobuf field string service_id = 3; - */ - protected $service_id = ''; - /** - * Required. The `Service` to create. - * - * Generated from protobuf field .google.monitoring.v3.Service service = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $service = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. Resource [name](https://cloud.google.com/monitoring/api/v3#project_name) of - * the parent workspace. The format is: - * projects/[PROJECT_ID_OR_NUMBER] - * @type string $service_id - * Optional. The Service id to use for this Service. If omitted, an id will be - * generated instead. Must match the pattern `[a-z0-9\-]+` - * @type \Google\Cloud\Monitoring\V3\Service $service - * Required. The `Service` to create. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\ServiceService::initOnce(); - parent::__construct($data); - } - - /** - * Required. Resource [name](https://cloud.google.com/monitoring/api/v3#project_name) of - * the parent workspace. The format is: - * projects/[PROJECT_ID_OR_NUMBER] - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. Resource [name](https://cloud.google.com/monitoring/api/v3#project_name) of - * the parent workspace. The format is: - * projects/[PROJECT_ID_OR_NUMBER] - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Optional. The Service id to use for this Service. If omitted, an id will be - * generated instead. Must match the pattern `[a-z0-9\-]+` - * - * Generated from protobuf field string service_id = 3; - * @return string - */ - public function getServiceId() - { - return $this->service_id; - } - - /** - * Optional. The Service id to use for this Service. If omitted, an id will be - * generated instead. Must match the pattern `[a-z0-9\-]+` - * - * Generated from protobuf field string service_id = 3; - * @param string $var - * @return $this - */ - public function setServiceId($var) - { - GPBUtil::checkString($var, True); - $this->service_id = $var; - - return $this; - } - - /** - * Required. The `Service` to create. - * - * Generated from protobuf field .google.monitoring.v3.Service service = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Monitoring\V3\Service|null - */ - public function getService() - { - return $this->service; - } - - public function hasService() - { - return isset($this->service); - } - - public function clearService() - { - unset($this->service); - } - - /** - * Required. The `Service` to create. - * - * Generated from protobuf field .google.monitoring.v3.Service service = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Monitoring\V3\Service $var - * @return $this - */ - public function setService($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\Service::class); - $this->service = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateTimeSeriesError.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateTimeSeriesError.php 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 f1432656f71..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateTimeSeriesRequest.php +++ /dev/null @@ -1,129 +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; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on - * which to execute the request. The format is: - * projects/[PROJECT_ID_OR_NUMBER] - * @type \Google\Cloud\Monitoring\V3\TimeSeries[]|\Google\Protobuf\Internal\RepeatedField $time_series - * Required. The new data to be added to a list of time series. - * Adds at most one data point to each of several time series. The new data - * point must be more recent than any other point in its time series. Each - * `TimeSeries` value must fully specify a unique time series by supplying - * all label values for the metric and the monitored resource. - * The maximum number of `TimeSeries` objects per `Create` request is 200. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\MetricService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on - * which to execute the request. The format is: - * projects/[PROJECT_ID_OR_NUMBER] - * - * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on - * which to execute the request. The format is: - * projects/[PROJECT_ID_OR_NUMBER] - * - * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Required. The new data to be added to a list of time series. - * Adds at most one data point to each of several time series. The new data - * point must be more recent than any other point in its time series. Each - * `TimeSeries` value must fully specify a unique time series by supplying - * all label values for the metric and the monitored resource. - * The maximum number of `TimeSeries` objects per `Create` request is 200. - * - * Generated from protobuf field repeated .google.monitoring.v3.TimeSeries time_series = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getTimeSeries() - { - return $this->time_series; - } - - /** - * Required. The new data to be added to a list of time series. - * Adds at most one data point to each of several time series. The new data - * point must be more recent than any other point in its time series. Each - * `TimeSeries` value must fully specify a unique time series by supplying - * all label values for the metric and the monitored resource. - * The maximum number of `TimeSeries` objects per `Create` request is 200. - * - * Generated from protobuf field repeated .google.monitoring.v3.TimeSeries time_series = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Monitoring\V3\TimeSeries[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setTimeSeries($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\TimeSeries::class); - $this->time_series = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateTimeSeriesSummary.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateTimeSeriesSummary.php deleted file mode 100644 index 6f92829d5d5..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 \Google\Cloud\Monitoring\V3\CreateTimeSeriesSummary\Error[]|\Google\Protobuf\Internal\RepeatedField $errors - * The number of points that failed to be written. Order is not guaranteed. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\MetricService::initOnce(); - parent::__construct($data); - } - - /** - * The number of points in the request. - * - * Generated from protobuf field int32 total_point_count = 1; - * @return int - */ - public function getTotalPointCount() - { - return $this->total_point_count; - } - - /** - * The number of points in the request. - * - * Generated from protobuf field int32 total_point_count = 1; - * @param int $var - * @return $this - */ - public function setTotalPointCount($var) - { - GPBUtil::checkInt32($var); - $this->total_point_count = $var; - - return $this; - } - - /** - * The number of points that were successfully written. - * - * Generated from protobuf field int32 success_point_count = 2; - * @return int - */ - public function getSuccessPointCount() - { - return $this->success_point_count; - } - - /** - * The number of points that were successfully written. - * - * Generated from protobuf field int32 success_point_count = 2; - * @param int $var - * @return $this - */ - public function setSuccessPointCount($var) - { - GPBUtil::checkInt32($var); - $this->success_point_count = $var; - - return $this; - } - - /** - * The number of points that failed to be written. Order is not guaranteed. - * - * Generated from protobuf field repeated .google.monitoring.v3.CreateTimeSeriesSummary.Error errors = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getErrors() - { - return $this->errors; - } - - /** - * The number of points that failed to be written. Order is not guaranteed. - * - * Generated from protobuf field repeated .google.monitoring.v3.CreateTimeSeriesSummary.Error errors = 3; - * @param \Google\Cloud\Monitoring\V3\CreateTimeSeriesSummary\Error[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setErrors($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\CreateTimeSeriesSummary\Error::class); - $this->errors = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateTimeSeriesSummary/Error.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateTimeSeriesSummary/Error.php 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/CreateTimeSeriesSummary_Error.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateTimeSeriesSummary_Error.php deleted file mode 100644 index c67ed832082..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/CreateTimeSeriesSummary_Error.php +++ /dev/null @@ -1,16 +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; - - /** - * 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 cd0c679c15c..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteAlertPolicyRequest.php +++ /dev/null @@ -1,75 +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 = ''; - - /** - * 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 abdd5172be3..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteGroupRequest.php +++ /dev/null @@ -1,114 +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; - - /** - * 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 a324673311b..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteMetricDescriptorRequest.php +++ /dev/null @@ -1,79 +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 = ''; - - /** - * 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 4e669ca146c..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteNotificationChannelRequest.php +++ /dev/null @@ -1,117 +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; - - /** - * 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 5ded10c0c5e..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteServiceLevelObjectiveRequest.php +++ /dev/null @@ -1,71 +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 = ''; - - /** - * 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 6d45727d887..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteServiceRequest.php +++ /dev/null @@ -1,71 +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 = ''; - - /** - * 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 4b4db12f615..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/DeleteUptimeCheckConfigRequest.php +++ /dev/null @@ -1,71 +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 = ''; - - /** - * 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 9d787e9c0f1..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetAlertPolicyRequest.php +++ /dev/null @@ -1,71 +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 = ''; - - /** - * 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 cb684cb0df7..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetGroupRequest.php +++ /dev/null @@ -1,71 +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 = ''; - - /** - * 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 484810b3d65..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetMetricDescriptorRequest.php +++ /dev/null @@ -1,79 +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 = ''; - - /** - * 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 b670eae6406..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetMonitoredResourceDescriptorRequest.php +++ /dev/null @@ -1,79 +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 = ''; - - /** - * 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 8127d3ecfc6..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetNotificationChannelDescriptorRequest.php +++ /dev/null @@ -1,71 +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 = ''; - - /** - * 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 6fa708d810d..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetNotificationChannelRequest.php +++ /dev/null @@ -1,71 +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 = ''; - - /** - * 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 7bedf1e9a03..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetNotificationChannelVerificationCodeRequest.php +++ /dev/null @@ -1,151 +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; - - /** - * 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 89df3ff5ac8..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetServiceLevelObjectiveRequest.php +++ /dev/null @@ -1,117 +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; - - /** - * 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 6b40bdd8706..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetServiceRequest.php +++ /dev/null @@ -1,71 +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 = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Resource name of the `Service`. The format is: - * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\ServiceService::initOnce(); - parent::__construct($data); - } - - /** - * Required. Resource name of the `Service`. The format is: - * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. Resource name of the `Service`. The format is: - * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetUptimeCheckConfigRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetUptimeCheckConfigRequest.php deleted file mode 100644 index 8b0e2c94fa7..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GetUptimeCheckConfigRequest.php +++ /dev/null @@ -1,71 +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 = ''; - - /** - * 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/GroupServiceGrpcClient.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GroupServiceGrpcClient.php deleted file mode 100644 index cc6e9b51953..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/GroupServiceGrpcClient.php +++ /dev/null @@ -1,137 +0,0 @@ -_simpleRequest('/google.monitoring.v3.GroupService/ListGroups', - $argument, - ['\Google\Cloud\Monitoring\V3\ListGroupsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets a single group. - * @param \Google\Cloud\Monitoring\V3\GetGroupRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetGroup(\Google\Cloud\Monitoring\V3\GetGroupRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.monitoring.v3.GroupService/GetGroup', - $argument, - ['\Google\Cloud\Monitoring\V3\Group', 'decode'], - $metadata, $options); - } - - /** - * Creates a new group. - * @param \Google\Cloud\Monitoring\V3\CreateGroupRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateGroup(\Google\Cloud\Monitoring\V3\CreateGroupRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.monitoring.v3.GroupService/CreateGroup', - $argument, - ['\Google\Cloud\Monitoring\V3\Group', 'decode'], - $metadata, $options); - } - - /** - * Updates an existing group. - * You can change any group attributes except `name`. - * @param \Google\Cloud\Monitoring\V3\UpdateGroupRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateGroup(\Google\Cloud\Monitoring\V3\UpdateGroupRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.monitoring.v3.GroupService/UpdateGroup', - $argument, - ['\Google\Cloud\Monitoring\V3\Group', 'decode'], - $metadata, $options); - } - - /** - * Deletes an existing group. - * @param \Google\Cloud\Monitoring\V3\DeleteGroupRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteGroup(\Google\Cloud\Monitoring\V3\DeleteGroupRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.monitoring.v3.GroupService/DeleteGroup', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - - /** - * Lists the monitored resources that are members of a group. - * @param \Google\Cloud\Monitoring\V3\ListGroupMembersRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListGroupMembers(\Google\Cloud\Monitoring\V3\ListGroupMembersRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.monitoring.v3.GroupService/ListGroupMembers', - $argument, - ['\Google\Cloud\Monitoring\V3\ListGroupMembersResponse', 'decode'], - $metadata, $options); - } - -} diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/InternalChecker.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/InternalChecker.php deleted file mode 100644 index 32a4914d1b2..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/InternalChecker.php +++ /dev/null @@ -1,270 +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 Stackdriver Workspace project for the - * Uptime check config associated with the internal checker. - * - * Generated from protobuf field string name = 1; - */ - protected $name = ''; - /** - * The checker's human-readable name. The display name - * should be unique within a Stackdriver Workspace in order to make it easier - * to identify; however, uniqueness is not enforced. - * - * Generated from protobuf field string display_name = 2; - */ - protected $display_name = ''; - /** - * The [GCP VPC network](https://cloud.google.com/vpc/docs/vpc) where the - * internal resource lives (ex: "default"). - * - * Generated from protobuf field string network = 3; - */ - protected $network = ''; - /** - * The GCP zone the Uptime check should egress from. Only respected for - * internal Uptime checks, where internal_network is specified. - * - * Generated from protobuf field string gcp_zone = 4; - */ - protected $gcp_zone = ''; - /** - * The GCP project ID where the internal checker lives. Not necessary - * the same as the Workspace project. - * - * Generated from protobuf field string peer_project_id = 6; - */ - protected $peer_project_id = ''; - /** - * The current operational state of the internal checker. - * - * Generated from protobuf field .google.monitoring.v3.InternalChecker.State state = 7; - */ - protected $state = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * A unique resource name for this InternalChecker. The format is: - * projects/[PROJECT_ID_OR_NUMBER]/internalCheckers/[INTERNAL_CHECKER_ID] - * `[PROJECT_ID_OR_NUMBER]` is the Stackdriver Workspace project for the - * Uptime check config associated with the internal checker. - * @type string $display_name - * The checker's human-readable name. The display name - * should be unique within a Stackdriver Workspace in order to make it easier - * to identify; however, uniqueness is not enforced. - * @type string $network - * The [GCP VPC network](https://cloud.google.com/vpc/docs/vpc) where the - * internal resource lives (ex: "default"). - * @type string $gcp_zone - * The GCP zone the Uptime check should egress from. Only respected for - * internal Uptime checks, where internal_network is specified. - * @type string $peer_project_id - * The GCP project ID where the internal checker lives. Not necessary - * the same as the Workspace project. - * @type int $state - * The current operational state of the internal checker. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\Uptime::initOnce(); - parent::__construct($data); - } - - /** - * A unique resource name for this InternalChecker. The format is: - * projects/[PROJECT_ID_OR_NUMBER]/internalCheckers/[INTERNAL_CHECKER_ID] - * `[PROJECT_ID_OR_NUMBER]` is the Stackdriver Workspace project for the - * Uptime check config associated with the internal checker. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * A unique resource name for this InternalChecker. The format is: - * projects/[PROJECT_ID_OR_NUMBER]/internalCheckers/[INTERNAL_CHECKER_ID] - * `[PROJECT_ID_OR_NUMBER]` is the Stackdriver Workspace project for the - * Uptime check config associated with the internal checker. - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The checker's human-readable name. The display name - * should be unique within a Stackdriver Workspace in order to make it easier - * to identify; however, uniqueness is not enforced. - * - * Generated from protobuf field string display_name = 2; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * The checker's human-readable name. The display name - * should be unique within a Stackdriver Workspace in order to make it easier - * to identify; however, uniqueness is not enforced. - * - * Generated from protobuf field string display_name = 2; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - - /** - * The [GCP VPC network](https://cloud.google.com/vpc/docs/vpc) where the - * internal resource lives (ex: "default"). - * - * Generated from protobuf field string network = 3; - * @return string - */ - public function getNetwork() - { - return $this->network; - } - - /** - * The [GCP VPC network](https://cloud.google.com/vpc/docs/vpc) where the - * internal resource lives (ex: "default"). - * - * Generated from protobuf field string network = 3; - * @param string $var - * @return $this - */ - public function setNetwork($var) - { - GPBUtil::checkString($var, True); - $this->network = $var; - - return $this; - } - - /** - * The GCP zone the Uptime check should egress from. Only respected for - * internal Uptime checks, where internal_network is specified. - * - * Generated from protobuf field string gcp_zone = 4; - * @return string - */ - public function getGcpZone() - { - return $this->gcp_zone; - } - - /** - * The GCP zone the Uptime check should egress from. Only respected for - * internal Uptime checks, where internal_network is specified. - * - * Generated from protobuf field string gcp_zone = 4; - * @param string $var - * @return $this - */ - public function setGcpZone($var) - { - GPBUtil::checkString($var, True); - $this->gcp_zone = $var; - - return $this; - } - - /** - * The GCP project ID where the internal checker lives. Not necessary - * the same as the Workspace project. - * - * Generated from protobuf field string peer_project_id = 6; - * @return string - */ - public function getPeerProjectId() - { - return $this->peer_project_id; - } - - /** - * The GCP project ID where the internal checker lives. Not necessary - * the same as the Workspace project. - * - * Generated from protobuf field string peer_project_id = 6; - * @param string $var - * @return $this - */ - public function setPeerProjectId($var) - { - GPBUtil::checkString($var, True); - $this->peer_project_id = $var; - - return $this; - } - - /** - * The current operational state of the internal checker. - * - * Generated from protobuf field .google.monitoring.v3.InternalChecker.State state = 7; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * The current operational state of the internal checker. - * - * Generated from protobuf field .google.monitoring.v3.InternalChecker.State state = 7; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\InternalChecker\State::class); - $this->state = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/InternalChecker/State.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/InternalChecker/State.php 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/InternalChecker_State.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/InternalChecker_State.php deleted file mode 100644 index a698aa7f4bb..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/InternalChecker_State.php +++ /dev/null @@ -1,16 +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 4e4bd653462..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListAlertPoliciesRequest.php +++ /dev/null @@ -1,267 +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 = ''; - - /** - * 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 1a4af7005a9..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 \Google\Cloud\Monitoring\V3\AlertPolicy[]|\Google\Protobuf\Internal\RepeatedField $alert_policies - * The returned alert policies. - * @type string $next_page_token - * If there might be more results than were returned, then this field is set - * to a non-empty value. To see the additional results, - * use that value as `page_token` in the next call to this method. - * @type int $total_size - * The total number of alert policies in all pages. This number is only an - * estimate, and may change in subsequent pages. https://aip.dev/158 - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\AlertService::initOnce(); - parent::__construct($data); - } - - /** - * The returned alert policies. - * - * Generated from protobuf field repeated .google.monitoring.v3.AlertPolicy alert_policies = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getAlertPolicies() - { - return $this->alert_policies; - } - - /** - * The returned alert policies. - * - * Generated from protobuf field repeated .google.monitoring.v3.AlertPolicy alert_policies = 3; - * @param \Google\Cloud\Monitoring\V3\AlertPolicy[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setAlertPolicies($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\AlertPolicy::class); - $this->alert_policies = $arr; - - return $this; - } - - /** - * If there might be more results than were returned, then this field is set - * to a non-empty value. To see the additional results, - * use that value as `page_token` in the next call to this method. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * If there might be more results than were returned, then this field is set - * to a non-empty value. To see the additional results, - * use that value as `page_token` in the next call to this method. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - - /** - * The total number of alert policies in all pages. This number is only an - * estimate, and may change in subsequent pages. https://aip.dev/158 - * - * Generated from protobuf field int32 total_size = 4; - * @return int - */ - public function getTotalSize() - { - return $this->total_size; - } - - /** - * The total number of alert policies in all pages. This number is only an - * estimate, and may change in subsequent pages. https://aip.dev/158 - * - * Generated from protobuf field int32 total_size = 4; - * @param int $var - * @return $this - */ - public function setTotalSize($var) - { - GPBUtil::checkInt32($var); - $this->total_size = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListGroupMembersRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListGroupMembersRequest.php deleted file mode 100644 index b799f825a6f..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListGroupMembersRequest.php +++ /dev/null @@ -1,261 +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; - - /** - * 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 1653ed4a466..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 \Google\Api\MonitoredResource[]|\Google\Protobuf\Internal\RepeatedField $members - * A set of monitored resources in the group. - * @type string $next_page_token - * If there are more results than have been returned, then this field is - * set to a non-empty value. To see the additional results, use that value as - * `page_token` in the next call to this method. - * @type int $total_size - * The total number of elements matching this request. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\GroupService::initOnce(); - parent::__construct($data); - } - - /** - * A set of monitored resources in the group. - * - * Generated from protobuf field repeated .google.api.MonitoredResource members = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getMembers() - { - return $this->members; - } - - /** - * A set of monitored resources in the group. - * - * Generated from protobuf field repeated .google.api.MonitoredResource members = 1; - * @param \Google\Api\MonitoredResource[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setMembers($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Api\MonitoredResource::class); - $this->members = $arr; - - return $this; - } - - /** - * If there are more results than have been returned, then this field is - * set to a non-empty value. To see the additional results, use that value as - * `page_token` in the next call to this method. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * If there are more results than have been returned, then this field is - * set to a non-empty value. To see the additional results, use that value as - * `page_token` in the next call to this method. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - - /** - * The total number of elements matching this request. - * - * Generated from protobuf field int32 total_size = 3; - * @return int - */ - public function getTotalSize() - { - return $this->total_size; - } - - /** - * The total number of elements matching this request. - * - * Generated from protobuf field int32 total_size = 3; - * @param int $var - * @return $this - */ - public function setTotalSize($var) - { - GPBUtil::checkInt32($var); - $this->total_size = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListGroupsRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListGroupsRequest.php deleted file mode 100644 index 6fde7d488d4..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListGroupsRequest.php +++ /dev/null @@ -1,295 +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; - - /** - * 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 d59de2292c7..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 \Google\Cloud\Monitoring\V3\Group[]|\Google\Protobuf\Internal\RepeatedField $group - * The groups that match the specified filters. - * @type string $next_page_token - * If there are more results than have been returned, then this field is set - * to a non-empty value. To see the additional results, - * use that value as `page_token` in the next call to this method. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\GroupService::initOnce(); - parent::__construct($data); - } - - /** - * The groups that match the specified filters. - * - * Generated from protobuf field repeated .google.monitoring.v3.Group group = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getGroup() - { - return $this->group; - } - - /** - * The groups that match the specified filters. - * - * Generated from protobuf field repeated .google.monitoring.v3.Group group = 1; - * @param \Google\Cloud\Monitoring\V3\Group[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setGroup($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\Group::class); - $this->group = $arr; - - return $this; - } - - /** - * If there are more results than have been returned, then this field is set - * to a non-empty value. To see the additional results, - * use that value as `page_token` in the next call to this method. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * If there are more results than have been returned, then this field is set - * to a non-empty value. To see the additional results, - * use that value as `page_token` in the next call to this method. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListMetricDescriptorsRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListMetricDescriptorsRequest.php deleted file mode 100644 index 141c7cb152c..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListMetricDescriptorsRequest.php +++ /dev/null @@ -1,209 +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. - * - * Generated from protobuf field int32 page_size = 3; - */ - protected $page_size = 0; - /** - * If this field is not empty then it must contain the `nextPageToken` value - * returned by a previous call to this method. Using this field causes the - * method to return additional results from the previous method call. - * - * Generated from protobuf field string page_token = 4; - */ - protected $page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on - * which to execute the request. The format is: - * projects/[PROJECT_ID_OR_NUMBER] - * @type string $filter - * If this field is empty, all custom and - * system-defined metric descriptors are returned. - * Otherwise, the [filter](https://cloud.google.com/monitoring/api/v3/filters) - * specifies which metric descriptors are to be - * returned. For example, the following filter matches all - * [custom metrics](https://cloud.google.com/monitoring/custom-metrics): - * metric.type = starts_with("custom.googleapis.com/") - * @type int $page_size - * A positive number that is the maximum number of results to return. - * @type string $page_token - * If this field is not empty then it must contain the `nextPageToken` value - * returned by a previous call to this method. Using this field causes the - * method to return additional results from the previous method call. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\MetricService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on - * which to execute the request. The format is: - * projects/[PROJECT_ID_OR_NUMBER] - * - * Generated from protobuf field string name = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on - * which to execute the request. The format is: - * projects/[PROJECT_ID_OR_NUMBER] - * - * Generated from protobuf field string name = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * If this field is empty, all custom and - * system-defined metric descriptors are returned. - * Otherwise, the [filter](https://cloud.google.com/monitoring/api/v3/filters) - * specifies which metric descriptors are to be - * returned. For example, the following filter matches all - * [custom metrics](https://cloud.google.com/monitoring/custom-metrics): - * metric.type = starts_with("custom.googleapis.com/") - * - * Generated from protobuf field string filter = 2; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * If this field is empty, all custom and - * system-defined metric descriptors are returned. - * Otherwise, the [filter](https://cloud.google.com/monitoring/api/v3/filters) - * specifies which metric descriptors are to be - * returned. For example, the following filter matches all - * [custom metrics](https://cloud.google.com/monitoring/custom-metrics): - * metric.type = starts_with("custom.googleapis.com/") - * - * Generated from protobuf field string filter = 2; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * A positive number that is the maximum number of results to return. - * - * Generated from protobuf field int32 page_size = 3; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * A positive number that is the maximum number of results to return. - * - * Generated from protobuf field int32 page_size = 3; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * If this field is not empty then it must contain the `nextPageToken` value - * returned by a previous call to this method. Using this field causes the - * method to return additional results from the previous method call. - * - * Generated from protobuf field string page_token = 4; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * If this field is not empty then it must contain the `nextPageToken` value - * returned by a previous call to this method. Using this field causes the - * method to return additional results from the previous method call. - * - * Generated from protobuf field string page_token = 4; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListMetricDescriptorsResponse.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListMetricDescriptorsResponse.php deleted file mode 100644 index 34955debbf7..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 \Google\Api\MetricDescriptor[]|\Google\Protobuf\Internal\RepeatedField $metric_descriptors - * The metric descriptors that are available to the project - * and that match the value of `filter`, if present. - * @type string $next_page_token - * If there are more results than have been returned, then this field is set - * to a non-empty value. To see the additional results, - * use that value as `page_token` in the next call to this method. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\MetricService::initOnce(); - parent::__construct($data); - } - - /** - * The metric descriptors that are available to the project - * and that match the value of `filter`, if present. - * - * Generated from protobuf field repeated .google.api.MetricDescriptor metric_descriptors = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getMetricDescriptors() - { - return $this->metric_descriptors; - } - - /** - * The metric descriptors that are available to the project - * and that match the value of `filter`, if present. - * - * Generated from protobuf field repeated .google.api.MetricDescriptor metric_descriptors = 1; - * @param \Google\Api\MetricDescriptor[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setMetricDescriptors($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Api\MetricDescriptor::class); - $this->metric_descriptors = $arr; - - return $this; - } - - /** - * If there are more results than have been returned, then this field is set - * to a non-empty value. To see the additional results, - * use that value as `page_token` in the next call to this method. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * If there are more results than have been returned, then this field is set - * to a non-empty value. To see the additional results, - * use that value as `page_token` in the next call to this method. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListMonitoredResourceDescriptorsRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListMonitoredResourceDescriptorsRequest.php deleted file mode 100644 index a205b0daf20..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListMonitoredResourceDescriptorsRequest.php +++ /dev/null @@ -1,201 +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 = ''; - - /** - * 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 9a3bf63be47..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 \Google\Api\MonitoredResourceDescriptor[]|\Google\Protobuf\Internal\RepeatedField $resource_descriptors - * The monitored resource descriptors that are available to this project - * and that match `filter`, if present. - * @type string $next_page_token - * If there are more results than have been returned, then this field is set - * to a non-empty value. To see the additional results, - * use that value as `page_token` in the next call to this method. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\MetricService::initOnce(); - parent::__construct($data); - } - - /** - * The monitored resource descriptors that are available to this project - * and that match `filter`, if present. - * - * Generated from protobuf field repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getResourceDescriptors() - { - return $this->resource_descriptors; - } - - /** - * The monitored resource descriptors that are available to this project - * and that match `filter`, if present. - * - * Generated from protobuf field repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; - * @param \Google\Api\MonitoredResourceDescriptor[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setResourceDescriptors($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Api\MonitoredResourceDescriptor::class); - $this->resource_descriptors = $arr; - - return $this; - } - - /** - * If there are more results than have been returned, then this field is set - * to a non-empty value. To see the additional results, - * use that value as `page_token` in the next call to this method. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * If there are more results than have been returned, then this field is set - * to a non-empty value. To see the additional results, - * use that value as `page_token` in the next call to this method. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListNotificationChannelDescriptorsRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListNotificationChannelDescriptorsRequest.php deleted file mode 100644 index 7f5d3764bcf..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListNotificationChannelDescriptorsRequest.php +++ /dev/null @@ -1,183 +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 = ''; - - /** - * 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 d4aaf9aaece..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 \Google\Cloud\Monitoring\V3\NotificationChannelDescriptor[]|\Google\Protobuf\Internal\RepeatedField $channel_descriptors - * The monitored resource descriptors supported for the specified - * project, optionally filtered. - * @type string $next_page_token - * If not empty, indicates that there may be more results that match - * the request. Use the value in the `page_token` field in a - * subsequent request to fetch the next set of results. If empty, - * all results have been returned. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\NotificationService::initOnce(); - parent::__construct($data); - } - - /** - * The monitored resource descriptors supported for the specified - * project, optionally filtered. - * - * Generated from protobuf field repeated .google.monitoring.v3.NotificationChannelDescriptor channel_descriptors = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getChannelDescriptors() - { - return $this->channel_descriptors; - } - - /** - * The monitored resource descriptors supported for the specified - * project, optionally filtered. - * - * Generated from protobuf field repeated .google.monitoring.v3.NotificationChannelDescriptor channel_descriptors = 1; - * @param \Google\Cloud\Monitoring\V3\NotificationChannelDescriptor[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setChannelDescriptors($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\NotificationChannelDescriptor::class); - $this->channel_descriptors = $arr; - - return $this; - } - - /** - * If not empty, indicates that there may be more results that match - * the request. Use the value in the `page_token` field in a - * subsequent request to fetch the next set of results. If empty, - * all results have been returned. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * If not empty, indicates that there may be more results that match - * the request. Use the value in the `page_token` field in a - * subsequent request to fetch the next set of results. If empty, - * all results have been returned. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListNotificationChannelsRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListNotificationChannelsRequest.php deleted file mode 100644 index 722e286a209..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListNotificationChannelsRequest.php +++ /dev/null @@ -1,279 +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 = ''; - - /** - * 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 b56750a1f2b..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 \Google\Cloud\Monitoring\V3\NotificationChannel[]|\Google\Protobuf\Internal\RepeatedField $notification_channels - * The notification channels defined for the specified project. - * @type string $next_page_token - * If not empty, indicates that there may be more results that match - * the request. Use the value in the `page_token` field in a - * subsequent request to fetch the next set of results. If empty, - * all results have been returned. - * @type int $total_size - * The total number of notification channels in all pages. This number is only - * an estimate, and may change in subsequent pages. https://aip.dev/158 - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\NotificationService::initOnce(); - parent::__construct($data); - } - - /** - * The notification channels defined for the specified project. - * - * Generated from protobuf field repeated .google.monitoring.v3.NotificationChannel notification_channels = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getNotificationChannels() - { - return $this->notification_channels; - } - - /** - * The notification channels defined for the specified project. - * - * Generated from protobuf field repeated .google.monitoring.v3.NotificationChannel notification_channels = 3; - * @param \Google\Cloud\Monitoring\V3\NotificationChannel[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setNotificationChannels($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\NotificationChannel::class); - $this->notification_channels = $arr; - - return $this; - } - - /** - * If not empty, indicates that there may be more results that match - * the request. Use the value in the `page_token` field in a - * subsequent request to fetch the next set of results. If empty, - * all results have been returned. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * If not empty, indicates that there may be more results that match - * the request. Use the value in the `page_token` field in a - * subsequent request to fetch the next set of results. If empty, - * all results have been returned. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - - /** - * The total number of notification channels in all pages. This number is only - * an estimate, and may change in subsequent pages. https://aip.dev/158 - * - * Generated from protobuf field int32 total_size = 4; - * @return int - */ - public function getTotalSize() - { - return $this->total_size; - } - - /** - * The total number of notification channels in all pages. This number is only - * an estimate, and may change in subsequent pages. https://aip.dev/158 - * - * Generated from protobuf field int32 total_size = 4; - * @param int $var - * @return $this - */ - public function setTotalSize($var) - { - GPBUtil::checkInt32($var); - $this->total_size = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListServiceLevelObjectivesRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListServiceLevelObjectivesRequest.php deleted file mode 100644 index cfe49f0b1c5..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListServiceLevelObjectivesRequest.php +++ /dev/null @@ -1,239 +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 Workspace. The formats are: - * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] - * workspaces/[HOST_PROJECT_ID_OR_NUMBER]/services/- - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * A filter specifying what `ServiceLevelObjective`s to return. - * - * Generated from protobuf field string filter = 2; - */ - protected $filter = ''; - /** - * A non-negative number that is the maximum number of results to return. - * When 0, use default page size. - * - * Generated from protobuf field int32 page_size = 3; - */ - protected $page_size = 0; - /** - * If this field is not empty then it must contain the `nextPageToken` value - * returned by a previous call to this method. Using this field causes the - * method to return additional results from the previous method call. - * - * Generated from protobuf field string page_token = 4; - */ - protected $page_token = ''; - /** - * View of the `ServiceLevelObjective`s to return. If `DEFAULT`, return each - * `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the - * `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the - * `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed. - * - * Generated from protobuf field .google.monitoring.v3.ServiceLevelObjective.View view = 5; - */ - protected $view = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. Resource name of the parent containing the listed SLOs, either a - * project or a Monitoring Workspace. The formats are: - * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] - * workspaces/[HOST_PROJECT_ID_OR_NUMBER]/services/- - * @type string $filter - * A filter specifying what `ServiceLevelObjective`s to return. - * @type int $page_size - * A non-negative number that is the maximum number of results to return. - * When 0, use default page size. - * @type string $page_token - * If this field is not empty then it must contain the `nextPageToken` value - * returned by a previous call to this method. Using this field causes the - * method to return additional results from the previous method call. - * @type int $view - * View of the `ServiceLevelObjective`s to return. If `DEFAULT`, return each - * `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the - * `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the - * `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\ServiceService::initOnce(); - parent::__construct($data); - } - - /** - * Required. Resource name of the parent containing the listed SLOs, either a - * project or a Monitoring Workspace. The formats are: - * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] - * workspaces/[HOST_PROJECT_ID_OR_NUMBER]/services/- - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. Resource name of the parent containing the listed SLOs, either a - * project or a Monitoring Workspace. The formats are: - * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] - * workspaces/[HOST_PROJECT_ID_OR_NUMBER]/services/- - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * A filter specifying what `ServiceLevelObjective`s to return. - * - * Generated from protobuf field string filter = 2; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * A filter specifying what `ServiceLevelObjective`s to return. - * - * Generated from protobuf field string filter = 2; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * A non-negative number that is the maximum number of results to return. - * When 0, use default page size. - * - * Generated from protobuf field int32 page_size = 3; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * A non-negative number that is the maximum number of results to return. - * When 0, use default page size. - * - * Generated from protobuf field int32 page_size = 3; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * If this field is not empty then it must contain the `nextPageToken` value - * returned by a previous call to this method. Using this field causes the - * method to return additional results from the previous method call. - * - * Generated from protobuf field string page_token = 4; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * If this field is not empty then it must contain the `nextPageToken` value - * returned by a previous call to this method. Using this field causes the - * method to return additional results from the previous method call. - * - * Generated from protobuf field string page_token = 4; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * View of the `ServiceLevelObjective`s to return. If `DEFAULT`, return each - * `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the - * `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the - * `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed. - * - * Generated from protobuf field .google.monitoring.v3.ServiceLevelObjective.View view = 5; - * @return int - */ - public function getView() - { - return $this->view; - } - - /** - * View of the `ServiceLevelObjective`s to return. If `DEFAULT`, return each - * `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the - * `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the - * `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed. - * - * Generated from protobuf field .google.monitoring.v3.ServiceLevelObjective.View view = 5; - * @param int $var - * @return $this - */ - public function setView($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\ServiceLevelObjective\View::class); - $this->view = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListServiceLevelObjectivesResponse.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListServiceLevelObjectivesResponse.php deleted file mode 100644 index 5b896f02405..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 \Google\Cloud\Monitoring\V3\ServiceLevelObjective[]|\Google\Protobuf\Internal\RepeatedField $service_level_objectives - * The `ServiceLevelObjective`s matching the specified filter. - * @type string $next_page_token - * If there are more results than have been returned, then this field is set - * to a non-empty value. To see the additional results, - * use that value as `page_token` in the next call to this method. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\ServiceService::initOnce(); - parent::__construct($data); - } - - /** - * The `ServiceLevelObjective`s matching the specified filter. - * - * Generated from protobuf field repeated .google.monitoring.v3.ServiceLevelObjective service_level_objectives = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getServiceLevelObjectives() - { - return $this->service_level_objectives; - } - - /** - * The `ServiceLevelObjective`s matching the specified filter. - * - * Generated from protobuf field repeated .google.monitoring.v3.ServiceLevelObjective service_level_objectives = 1; - * @param \Google\Cloud\Monitoring\V3\ServiceLevelObjective[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setServiceLevelObjectives($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\ServiceLevelObjective::class); - $this->service_level_objectives = $arr; - - return $this; - } - - /** - * If there are more results than have been returned, then this field is set - * to a non-empty value. To see the additional results, - * use that value as `page_token` in the next call to this method. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * If there are more results than have been returned, then this field is set - * to a non-empty value. To see the additional results, - * use that value as `page_token` in the next call to this method. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListServicesRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListServicesRequest.php deleted file mode 100644 index 5fcb43d6fa8..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListServicesRequest.php +++ /dev/null @@ -1,261 +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 Workspace. The formats are: - * projects/[PROJECT_ID_OR_NUMBER] - * workspaces/[HOST_PROJECT_ID_OR_NUMBER] - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * A filter specifying what `Service`s to return. The filter currently - * supports the following fields: - * - `identifier_case` - * - `app_engine.module_id` - * - `cloud_endpoints.service` (reserved for future use) - * - `mesh_istio.mesh_uid` - * - `mesh_istio.service_namespace` - * - `mesh_istio.service_name` - * - `cluster_istio.location` (deprecated) - * - `cluster_istio.cluster_name` (deprecated) - * - `cluster_istio.service_namespace` (deprecated) - * - `cluster_istio.service_name` (deprecated) - * `identifier_case` refers to which option in the identifier oneof is - * populated. For example, the filter `identifier_case = "CUSTOM"` would match - * all services with a value for the `custom` field. Valid options are - * "CUSTOM", "APP_ENGINE", "MESH_ISTIO", plus "CLUSTER_ISTIO" (deprecated) - * and "CLOUD_ENDPOINTS" (reserved for future use). - * - * Generated from protobuf field string filter = 2; - */ - protected $filter = ''; - /** - * A non-negative number that is the maximum number of results to return. - * When 0, use default page size. - * - * Generated from protobuf field int32 page_size = 3; - */ - protected $page_size = 0; - /** - * If this field is not empty then it must contain the `nextPageToken` value - * returned by a previous call to this method. Using this field causes the - * method to return additional results from the previous method call. - * - * Generated from protobuf field string page_token = 4; - */ - protected $page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. Resource name of the parent containing the listed services, either a - * [project](https://cloud.google.com/monitoring/api/v3#project_name) or a - * Monitoring Workspace. The formats are: - * projects/[PROJECT_ID_OR_NUMBER] - * workspaces/[HOST_PROJECT_ID_OR_NUMBER] - * @type string $filter - * A filter specifying what `Service`s to return. The filter currently - * supports the following fields: - * - `identifier_case` - * - `app_engine.module_id` - * - `cloud_endpoints.service` (reserved for future use) - * - `mesh_istio.mesh_uid` - * - `mesh_istio.service_namespace` - * - `mesh_istio.service_name` - * - `cluster_istio.location` (deprecated) - * - `cluster_istio.cluster_name` (deprecated) - * - `cluster_istio.service_namespace` (deprecated) - * - `cluster_istio.service_name` (deprecated) - * `identifier_case` refers to which option in the identifier oneof is - * populated. For example, the filter `identifier_case = "CUSTOM"` would match - * all services with a value for the `custom` field. Valid options are - * "CUSTOM", "APP_ENGINE", "MESH_ISTIO", plus "CLUSTER_ISTIO" (deprecated) - * and "CLOUD_ENDPOINTS" (reserved for future use). - * @type int $page_size - * A non-negative number that is the maximum number of results to return. - * When 0, use default page size. - * @type string $page_token - * If this field is not empty then it must contain the `nextPageToken` value - * returned by a previous call to this method. Using this field causes the - * method to return additional results from the previous method call. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\ServiceService::initOnce(); - parent::__construct($data); - } - - /** - * Required. Resource name of the parent containing the listed services, either a - * [project](https://cloud.google.com/monitoring/api/v3#project_name) or a - * Monitoring Workspace. The formats are: - * projects/[PROJECT_ID_OR_NUMBER] - * workspaces/[HOST_PROJECT_ID_OR_NUMBER] - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. Resource name of the parent containing the listed services, either a - * [project](https://cloud.google.com/monitoring/api/v3#project_name) or a - * Monitoring Workspace. The formats are: - * projects/[PROJECT_ID_OR_NUMBER] - * workspaces/[HOST_PROJECT_ID_OR_NUMBER] - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * A filter specifying what `Service`s to return. The filter currently - * supports the following fields: - * - `identifier_case` - * - `app_engine.module_id` - * - `cloud_endpoints.service` (reserved for future use) - * - `mesh_istio.mesh_uid` - * - `mesh_istio.service_namespace` - * - `mesh_istio.service_name` - * - `cluster_istio.location` (deprecated) - * - `cluster_istio.cluster_name` (deprecated) - * - `cluster_istio.service_namespace` (deprecated) - * - `cluster_istio.service_name` (deprecated) - * `identifier_case` refers to which option in the identifier oneof is - * populated. For example, the filter `identifier_case = "CUSTOM"` would match - * all services with a value for the `custom` field. Valid options are - * "CUSTOM", "APP_ENGINE", "MESH_ISTIO", plus "CLUSTER_ISTIO" (deprecated) - * and "CLOUD_ENDPOINTS" (reserved for future use). - * - * Generated from protobuf field string filter = 2; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * A filter specifying what `Service`s to return. The filter currently - * supports the following fields: - * - `identifier_case` - * - `app_engine.module_id` - * - `cloud_endpoints.service` (reserved for future use) - * - `mesh_istio.mesh_uid` - * - `mesh_istio.service_namespace` - * - `mesh_istio.service_name` - * - `cluster_istio.location` (deprecated) - * - `cluster_istio.cluster_name` (deprecated) - * - `cluster_istio.service_namespace` (deprecated) - * - `cluster_istio.service_name` (deprecated) - * `identifier_case` refers to which option in the identifier oneof is - * populated. For example, the filter `identifier_case = "CUSTOM"` would match - * all services with a value for the `custom` field. Valid options are - * "CUSTOM", "APP_ENGINE", "MESH_ISTIO", plus "CLUSTER_ISTIO" (deprecated) - * and "CLOUD_ENDPOINTS" (reserved for future use). - * - * Generated from protobuf field string filter = 2; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * A non-negative number that is the maximum number of results to return. - * When 0, use default page size. - * - * Generated from protobuf field int32 page_size = 3; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * A non-negative number that is the maximum number of results to return. - * When 0, use default page size. - * - * Generated from protobuf field int32 page_size = 3; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * If this field is not empty then it must contain the `nextPageToken` value - * returned by a previous call to this method. Using this field causes the - * method to return additional results from the previous method call. - * - * Generated from protobuf field string page_token = 4; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * If this field is not empty then it must contain the `nextPageToken` value - * returned by a previous call to this method. Using this field causes the - * method to return additional results from the previous method call. - * - * Generated from protobuf field string page_token = 4; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListServicesResponse.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListServicesResponse.php deleted file mode 100644 index fd89f9ada87..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 \Google\Cloud\Monitoring\V3\Service[]|\Google\Protobuf\Internal\RepeatedField $services - * The `Service`s matching the specified filter. - * @type string $next_page_token - * If there are more results than have been returned, then this field is set - * to a non-empty value. To see the additional results, - * use that value as `page_token` in the next call to this method. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\ServiceService::initOnce(); - parent::__construct($data); - } - - /** - * The `Service`s matching the specified filter. - * - * Generated from protobuf field repeated .google.monitoring.v3.Service services = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getServices() - { - return $this->services; - } - - /** - * The `Service`s matching the specified filter. - * - * Generated from protobuf field repeated .google.monitoring.v3.Service services = 1; - * @param \Google\Cloud\Monitoring\V3\Service[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setServices($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\Service::class); - $this->services = $arr; - - return $this; - } - - /** - * If there are more results than have been returned, then this field is set - * to a non-empty value. To see the additional results, - * use that value as `page_token` in the next call to this method. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * If there are more results than have been returned, then this field is set - * to a non-empty value. To see the additional results, - * use that value as `page_token` in the next call to this method. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListTimeSeriesRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListTimeSeriesRequest.php deleted file mode 100644 index e934a796289..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListTimeSeriesRequest.php +++ /dev/null @@ -1,457 +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 = ''; - - /** - * 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 4055777eb6d..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/ListTimeSeriesRequest_TimeSeriesView.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListTimeSeriesRequest_TimeSeriesView.php deleted file mode 100644 index 19e5f3ac9a7..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListTimeSeriesRequest_TimeSeriesView.php +++ /dev/null @@ -1,16 +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 \Google\Cloud\Monitoring\V3\TimeSeries[]|\Google\Protobuf\Internal\RepeatedField $time_series - * One or more time series that match the filter included in the request. - * @type string $next_page_token - * If there are more results than have been returned, then this field is set - * to a non-empty value. To see the additional results, - * use that value as `page_token` in the next call to this method. - * @type \Google\Rpc\Status[]|\Google\Protobuf\Internal\RepeatedField $execution_errors - * Query execution errors that may have caused the time series data returned - * to be incomplete. - * @type string $unit - * The unit in which all `time_series` point values are reported. `unit` - * follows the UCUM format for units as seen in - * https://unitsofmeasure.org/ucum.html. - * If different `time_series` have different units (for example, because they - * come from different metric types, or a unit is absent), then `unit` will be - * "{not_a_unit}". - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\MetricService::initOnce(); - parent::__construct($data); - } - - /** - * One or more time series that match the filter included in the request. - * - * Generated from protobuf field repeated .google.monitoring.v3.TimeSeries time_series = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getTimeSeries() - { - return $this->time_series; - } - - /** - * One or more time series that match the filter included in the request. - * - * Generated from protobuf field repeated .google.monitoring.v3.TimeSeries time_series = 1; - * @param \Google\Cloud\Monitoring\V3\TimeSeries[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setTimeSeries($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\TimeSeries::class); - $this->time_series = $arr; - - return $this; - } - - /** - * If there are more results than have been returned, then this field is set - * to a non-empty value. To see the additional results, - * use that value as `page_token` in the next call to this method. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * If there are more results than have been returned, then this field is set - * to a non-empty value. To see the additional results, - * use that value as `page_token` in the next call to this method. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - - /** - * Query execution errors that may have caused the time series data returned - * to be incomplete. - * - * Generated from protobuf field repeated .google.rpc.Status execution_errors = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getExecutionErrors() - { - return $this->execution_errors; - } - - /** - * Query execution errors that may have caused the time series data returned - * to be incomplete. - * - * Generated from protobuf field repeated .google.rpc.Status execution_errors = 3; - * @param \Google\Rpc\Status[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setExecutionErrors($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Rpc\Status::class); - $this->execution_errors = $arr; - - return $this; - } - - /** - * The unit in which all `time_series` point values are reported. `unit` - * follows the UCUM format for units as seen in - * https://unitsofmeasure.org/ucum.html. - * If different `time_series` have different units (for example, because they - * come from different metric types, or a unit is absent), then `unit` will be - * "{not_a_unit}". - * - * Generated from protobuf field string unit = 5; - * @return string - */ - public function getUnit() - { - return $this->unit; - } - - /** - * The unit in which all `time_series` point values are reported. `unit` - * follows the UCUM format for units as seen in - * https://unitsofmeasure.org/ucum.html. - * If different `time_series` have different units (for example, because they - * come from different metric types, or a unit is absent), then `unit` will be - * "{not_a_unit}". - * - * Generated from protobuf field string unit = 5; - * @param string $var - * @return $this - */ - public function setUnit($var) - { - GPBUtil::checkString($var, True); - $this->unit = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListUptimeCheckConfigsRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListUptimeCheckConfigsRequest.php deleted file mode 100644 index b706607acdb..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListUptimeCheckConfigsRequest.php +++ /dev/null @@ -1,163 +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 = ''; - /** - * The maximum number of results to return in a single response. The server - * may further constrain the maximum number of results returned in a single - * page. If the page_size is <=0, the server will decide the number of results - * to be returned. - * - * Generated from protobuf field int32 page_size = 3; - */ - protected $page_size = 0; - /** - * If this field is not empty then it must contain the `nextPageToken` value - * returned by a previous call to this method. Using this field causes the - * method to return more results from the previous method call. - * - * Generated from protobuf field string page_token = 4; - */ - protected $page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) - * whose Uptime check configurations are listed. The format is: - * projects/[PROJECT_ID_OR_NUMBER] - * @type int $page_size - * The maximum number of results to return in a single response. The server - * may further constrain the maximum number of results returned in a single - * page. If the page_size is <=0, the server will decide the number of results - * to be returned. - * @type string $page_token - * If this field is not empty then it must contain the `nextPageToken` value - * returned by a previous call to this method. Using this field causes the - * method to return more results from the previous method call. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\UptimeService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) - * whose Uptime check configurations are listed. The format is: - * projects/[PROJECT_ID_OR_NUMBER] - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) - * whose Uptime check configurations are listed. The format is: - * projects/[PROJECT_ID_OR_NUMBER] - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * The maximum number of results to return in a single response. The server - * may further constrain the maximum number of results returned in a single - * page. If the page_size is <=0, the server will decide the number of results - * to be returned. - * - * Generated from protobuf field int32 page_size = 3; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * The maximum number of results to return in a single response. The server - * may further constrain the maximum number of results returned in a single - * page. If the page_size is <=0, the server will decide the number of results - * to be returned. - * - * Generated from protobuf field int32 page_size = 3; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * If this field is not empty then it must contain the `nextPageToken` value - * returned by a previous call to this method. Using this field causes the - * method to return more results from the previous method call. - * - * Generated from protobuf field string page_token = 4; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * If this field is not empty then it must contain the `nextPageToken` value - * returned by a previous call to this method. Using this field causes the - * method to return more results from the previous method call. - * - * Generated from protobuf field string page_token = 4; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListUptimeCheckConfigsResponse.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListUptimeCheckConfigsResponse.php deleted file mode 100644 index 19b7a113300..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 \Google\Cloud\Monitoring\V3\UptimeCheckConfig[]|\Google\Protobuf\Internal\RepeatedField $uptime_check_configs - * The returned Uptime check configurations. - * @type string $next_page_token - * This field represents the pagination token to retrieve the next page of - * results. If the value is empty, it means no further results for the - * request. To retrieve the next page of results, the value of the - * next_page_token is passed to the subsequent List method call (in the - * request message's page_token field). - * @type int $total_size - * The total number of Uptime check configurations for the project, - * irrespective of any pagination. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\UptimeService::initOnce(); - parent::__construct($data); - } - - /** - * The returned Uptime check configurations. - * - * Generated from protobuf field repeated .google.monitoring.v3.UptimeCheckConfig uptime_check_configs = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getUptimeCheckConfigs() - { - return $this->uptime_check_configs; - } - - /** - * The returned Uptime check configurations. - * - * Generated from protobuf field repeated .google.monitoring.v3.UptimeCheckConfig uptime_check_configs = 1; - * @param \Google\Cloud\Monitoring\V3\UptimeCheckConfig[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setUptimeCheckConfigs($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\UptimeCheckConfig::class); - $this->uptime_check_configs = $arr; - - return $this; - } - - /** - * This field represents the pagination token to retrieve the next page of - * results. If the value is empty, it means no further results for the - * request. To retrieve the next page of results, the value of the - * next_page_token is passed to the subsequent List method call (in the - * request message's page_token field). - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * This field represents the pagination token to retrieve the next page of - * results. If the value is empty, it means no further results for the - * request. To retrieve the next page of results, the value of the - * next_page_token is passed to the subsequent List method call (in the - * request message's page_token field). - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - - /** - * The total number of Uptime check configurations for the project, - * irrespective of any pagination. - * - * Generated from protobuf field int32 total_size = 3; - * @return int - */ - public function getTotalSize() - { - return $this->total_size; - } - - /** - * The total number of Uptime check configurations for the project, - * irrespective of any pagination. - * - * Generated from protobuf field int32 total_size = 3; - * @param int $var - * @return $this - */ - public function setTotalSize($var) - { - GPBUtil::checkInt32($var); - $this->total_size = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListUptimeCheckIpsRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ListUptimeCheckIpsRequest.php 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 ad89ed7327a..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 \Google\Cloud\Monitoring\V3\UptimeCheckIp[]|\Google\Protobuf\Internal\RepeatedField $uptime_check_ips - * The returned list of IP addresses (including region and location) that the - * checkers run from. - * @type string $next_page_token - * This field represents the pagination token to retrieve the next page of - * results. If the value is empty, it means no further results for the - * request. To retrieve the next page of results, the value of the - * next_page_token is passed to the subsequent List method call (in the - * request message's page_token field). - * NOTE: this field is not yet implemented - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\UptimeService::initOnce(); - parent::__construct($data); - } - - /** - * The returned list of IP addresses (including region and location) that the - * checkers run from. - * - * Generated from protobuf field repeated .google.monitoring.v3.UptimeCheckIp uptime_check_ips = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getUptimeCheckIps() - { - return $this->uptime_check_ips; - } - - /** - * The returned list of IP addresses (including region and location) that the - * checkers run from. - * - * Generated from protobuf field repeated .google.monitoring.v3.UptimeCheckIp uptime_check_ips = 1; - * @param \Google\Cloud\Monitoring\V3\UptimeCheckIp[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setUptimeCheckIps($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\UptimeCheckIp::class); - $this->uptime_check_ips = $arr; - - return $this; - } - - /** - * This field represents the pagination token to retrieve the next page of - * results. If the value is empty, it means no further results for the - * request. To retrieve the next page of results, the value of the - * next_page_token is passed to the subsequent List method call (in the - * request message's page_token field). - * NOTE: this field is not yet implemented - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * This field represents the pagination token to retrieve the next page of - * results. If the value is empty, it means no further results for the - * request. To retrieve the next page of results, the value of the - * next_page_token is passed to the subsequent List method call (in the - * request message's page_token field). - * NOTE: this field is not yet implemented - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/MetricServiceGrpcClient.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/MetricServiceGrpcClient.php deleted file mode 100644 index 1b000965874..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/MetricServiceGrpcClient.php +++ /dev/null @@ -1,188 +0,0 @@ -_simpleRequest('/google.monitoring.v3.MetricService/ListMonitoredResourceDescriptors', - $argument, - ['\Google\Cloud\Monitoring\V3\ListMonitoredResourceDescriptorsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets a single monitored resource descriptor. This method does not require a Workspace. - * @param \Google\Cloud\Monitoring\V3\GetMonitoredResourceDescriptorRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetMonitoredResourceDescriptor(\Google\Cloud\Monitoring\V3\GetMonitoredResourceDescriptorRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.monitoring.v3.MetricService/GetMonitoredResourceDescriptor', - $argument, - ['\Google\Api\MonitoredResourceDescriptor', 'decode'], - $metadata, $options); - } - - /** - * Lists metric descriptors that match a filter. This method does not require a Workspace. - * @param \Google\Cloud\Monitoring\V3\ListMetricDescriptorsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListMetricDescriptors(\Google\Cloud\Monitoring\V3\ListMetricDescriptorsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.monitoring.v3.MetricService/ListMetricDescriptors', - $argument, - ['\Google\Cloud\Monitoring\V3\ListMetricDescriptorsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets a single metric descriptor. This method does not require a Workspace. - * @param \Google\Cloud\Monitoring\V3\GetMetricDescriptorRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetMetricDescriptor(\Google\Cloud\Monitoring\V3\GetMetricDescriptorRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.monitoring.v3.MetricService/GetMetricDescriptor', - $argument, - ['\Google\Api\MetricDescriptor', 'decode'], - $metadata, $options); - } - - /** - * Creates a new metric descriptor. - * The creation is executed asynchronously and callers may check the returned - * operation to track its progress. - * User-created metric descriptors define - * [custom metrics](https://cloud.google.com/monitoring/custom-metrics). - * @param \Google\Cloud\Monitoring\V3\CreateMetricDescriptorRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateMetricDescriptor(\Google\Cloud\Monitoring\V3\CreateMetricDescriptorRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.monitoring.v3.MetricService/CreateMetricDescriptor', - $argument, - ['\Google\Api\MetricDescriptor', 'decode'], - $metadata, $options); - } - - /** - * Deletes a metric descriptor. Only user-created - * [custom metrics](https://cloud.google.com/monitoring/custom-metrics) can be - * deleted. - * @param \Google\Cloud\Monitoring\V3\DeleteMetricDescriptorRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteMetricDescriptor(\Google\Cloud\Monitoring\V3\DeleteMetricDescriptorRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.monitoring.v3.MetricService/DeleteMetricDescriptor', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - - /** - * Lists time series that match a filter. This method does not require a Workspace. - * @param \Google\Cloud\Monitoring\V3\ListTimeSeriesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListTimeSeries(\Google\Cloud\Monitoring\V3\ListTimeSeriesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.monitoring.v3.MetricService/ListTimeSeries', - $argument, - ['\Google\Cloud\Monitoring\V3\ListTimeSeriesResponse', 'decode'], - $metadata, $options); - } - - /** - * Creates or adds data to one or more time series. - * The response is empty if all time series in the request were written. - * If any time series could not be written, a corresponding failure message is - * included in the error response. - * @param \Google\Cloud\Monitoring\V3\CreateTimeSeriesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateTimeSeries(\Google\Cloud\Monitoring\V3\CreateTimeSeriesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.monitoring.v3.MetricService/CreateTimeSeries', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - - /** - * Creates or adds data to one or more service time series. A service time - * series is a time series for a metric from a Google Cloud service. The - * response is empty if all time series in the request were written. If any - * time series could not be written, a corresponding failure message is - * included in the error response. This endpoint rejects writes to - * user-defined metrics. - * This method is only for use by Google Cloud services. Use - * [projects.timeSeries.create][google.monitoring.v3.MetricService.CreateTimeSeries] - * instead. - * @param \Google\Cloud\Monitoring\V3\CreateTimeSeriesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateServiceTimeSeries(\Google\Cloud\Monitoring\V3\CreateTimeSeriesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.monitoring.v3.MetricService/CreateServiceTimeSeries', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - -} diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/MutationRecord.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/MutationRecord.php 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 264f081e4f5..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/NotificationChannel.php +++ /dev/null @@ -1,586 +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 \Google\Cloud\Monitoring\V3\MutationRecord[]|\Google\Protobuf\Internal\RepeatedField $mutation_records - * Records of the modification of this channel. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\Notification::initOnce(); - parent::__construct($data); - } - - /** - * The type of the notification channel. This field matches the - * value of the [NotificationChannelDescriptor.type][google.monitoring.v3.NotificationChannelDescriptor.type] field. - * - * Generated from protobuf field string type = 1; - * @return string - */ - public function getType() - { - return $this->type; - } - - /** - * The type of the notification channel. This field matches the - * value of the [NotificationChannelDescriptor.type][google.monitoring.v3.NotificationChannelDescriptor.type] field. - * - * Generated from protobuf field string type = 1; - * @param string $var - * @return $this - */ - public function setType($var) - { - GPBUtil::checkString($var, True); - $this->type = $var; - - return $this; - } - - /** - * The full REST resource name for this channel. The format is: - * projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] - * The `[CHANNEL_ID]` is automatically assigned by the server on creation. - * - * Generated from protobuf field string name = 6; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The full REST resource name for this channel. The format is: - * projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] - * The `[CHANNEL_ID]` is automatically assigned by the server on creation. - * - * Generated from protobuf field string name = 6; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * An optional human-readable name for this notification channel. It is - * recommended that you specify a non-empty and unique name in order to - * make it easier to identify the channels in your project, though this is - * not enforced. The display name is limited to 512 Unicode characters. - * - * Generated from protobuf field string display_name = 3; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * An optional human-readable name for this notification channel. It is - * recommended that you specify a non-empty and unique name in order to - * make it easier to identify the channels in your project, though this is - * not enforced. The display name is limited to 512 Unicode characters. - * - * Generated from protobuf field string display_name = 3; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - - /** - * An optional human-readable description of this notification channel. This - * description may provide additional details, beyond the display - * name, for the channel. This may not exceed 1024 Unicode characters. - * - * Generated from protobuf field string description = 4; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * An optional human-readable description of this notification channel. This - * description may provide additional details, beyond the display - * name, for the channel. This may not exceed 1024 Unicode characters. - * - * Generated from protobuf field string description = 4; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * Configuration fields that define the channel and its behavior. The - * permissible and required labels are specified in the - * [NotificationChannelDescriptor.labels][google.monitoring.v3.NotificationChannelDescriptor.labels] of the - * `NotificationChannelDescriptor` corresponding to the `type` field. - * - * Generated from protobuf field map labels = 5; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Configuration fields that define the channel and its behavior. The - * permissible and required labels are specified in the - * [NotificationChannelDescriptor.labels][google.monitoring.v3.NotificationChannelDescriptor.labels] of the - * `NotificationChannelDescriptor` corresponding to the `type` field. - * - * Generated from protobuf field map labels = 5; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setLabels($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->labels = $arr; - - return $this; - } - - /** - * User-supplied key/value data that does not need to conform to - * the corresponding `NotificationChannelDescriptor`'s schema, unlike - * the `labels` field. This field is intended to be used for organizing - * and identifying the `NotificationChannel` objects. - * The field can contain up to 64 entries. Each key and value is limited to - * 63 Unicode characters or 128 bytes, whichever is smaller. Labels and - * values can contain only lowercase letters, numerals, underscores, and - * dashes. Keys must begin with a letter. - * - * Generated from protobuf field map user_labels = 8; - * @return \Google\Protobuf\Internal\MapField - */ - public function getUserLabels() - { - return $this->user_labels; - } - - /** - * User-supplied key/value data that does not need to conform to - * the corresponding `NotificationChannelDescriptor`'s schema, unlike - * the `labels` field. This field is intended to be used for organizing - * and identifying the `NotificationChannel` objects. - * The field can contain up to 64 entries. Each key and value is limited to - * 63 Unicode characters or 128 bytes, whichever is smaller. Labels and - * values can contain only lowercase letters, numerals, underscores, and - * dashes. Keys must begin with a letter. - * - * Generated from protobuf field map user_labels = 8; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setUserLabels($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->user_labels = $arr; - - return $this; - } - - /** - * Indicates whether this channel has been verified or not. On a - * [`ListNotificationChannels`][google.monitoring.v3.NotificationChannelService.ListNotificationChannels] - * or - * [`GetNotificationChannel`][google.monitoring.v3.NotificationChannelService.GetNotificationChannel] - * operation, this field is expected to be populated. - * If the value is `UNVERIFIED`, then it indicates that the channel is - * non-functioning (it both requires verification and lacks verification); - * otherwise, it is assumed that the channel works. - * If the channel is neither `VERIFIED` nor `UNVERIFIED`, it implies that - * the channel is of a type that does not require verification or that - * this specific channel has been exempted from verification because it was - * created prior to verification being required for channels of this type. - * This field cannot be modified using a standard - * [`UpdateNotificationChannel`][google.monitoring.v3.NotificationChannelService.UpdateNotificationChannel] - * operation. To change the value of this field, you must call - * [`VerifyNotificationChannel`][google.monitoring.v3.NotificationChannelService.VerifyNotificationChannel]. - * - * Generated from protobuf field .google.monitoring.v3.NotificationChannel.VerificationStatus verification_status = 9; - * @return int - */ - public function getVerificationStatus() - { - return $this->verification_status; - } - - /** - * Indicates whether this channel has been verified or not. On a - * [`ListNotificationChannels`][google.monitoring.v3.NotificationChannelService.ListNotificationChannels] - * or - * [`GetNotificationChannel`][google.monitoring.v3.NotificationChannelService.GetNotificationChannel] - * operation, this field is expected to be populated. - * If the value is `UNVERIFIED`, then it indicates that the channel is - * non-functioning (it both requires verification and lacks verification); - * otherwise, it is assumed that the channel works. - * If the channel is neither `VERIFIED` nor `UNVERIFIED`, it implies that - * the channel is of a type that does not require verification or that - * this specific channel has been exempted from verification because it was - * created prior to verification being required for channels of this type. - * This field cannot be modified using a standard - * [`UpdateNotificationChannel`][google.monitoring.v3.NotificationChannelService.UpdateNotificationChannel] - * operation. To change the value of this field, you must call - * [`VerifyNotificationChannel`][google.monitoring.v3.NotificationChannelService.VerifyNotificationChannel]. - * - * Generated from protobuf field .google.monitoring.v3.NotificationChannel.VerificationStatus verification_status = 9; - * @param int $var - * @return $this - */ - public function setVerificationStatus($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\NotificationChannel\VerificationStatus::class); - $this->verification_status = $var; - - return $this; - } - - /** - * Whether notifications are forwarded to the described channel. This makes - * it possible to disable delivery of notifications to a particular channel - * without removing the channel from all alerting policies that reference - * the channel. This is a more convenient approach when the change is - * temporary and you want to receive notifications from the same set - * of alerting policies on the channel at some point in the future. - * - * Generated from protobuf field .google.protobuf.BoolValue enabled = 11; - * @return \Google\Protobuf\BoolValue|null - */ - public function getEnabled() - { - return $this->enabled; - } - - public function hasEnabled() - { - return isset($this->enabled); - } - - public function clearEnabled() - { - unset($this->enabled); - } - - /** - * Returns the unboxed value from getEnabled() - - * Whether notifications are forwarded to the described channel. This makes - * it possible to disable delivery of notifications to a particular channel - * without removing the channel from all alerting policies that reference - * the channel. This is a more convenient approach when the change is - * temporary and you want to receive notifications from the same set - * of alerting policies on the channel at some point in the future. - * - * Generated from protobuf field .google.protobuf.BoolValue enabled = 11; - * @return bool|null - */ - public function getEnabledUnwrapped() - { - return $this->readWrapperValue("enabled"); - } - - /** - * Whether notifications are forwarded to the described channel. This makes - * it possible to disable delivery of notifications to a particular channel - * without removing the channel from all alerting policies that reference - * the channel. This is a more convenient approach when the change is - * temporary and you want to receive notifications from the same set - * of alerting policies on the channel at some point in the future. - * - * Generated from protobuf field .google.protobuf.BoolValue enabled = 11; - * @param \Google\Protobuf\BoolValue $var - * @return $this - */ - public function setEnabled($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\BoolValue::class); - $this->enabled = $var; - - return $this; - } - - /** - * Sets the field by wrapping a primitive type in a Google\Protobuf\BoolValue object. - - * Whether notifications are forwarded to the described channel. This makes - * it possible to disable delivery of notifications to a particular channel - * without removing the channel from all alerting policies that reference - * the channel. This is a more convenient approach when the change is - * temporary and you want to receive notifications from the same set - * of alerting policies on the channel at some point in the future. - * - * Generated from protobuf field .google.protobuf.BoolValue enabled = 11; - * @param bool|null $var - * @return $this - */ - public function setEnabledUnwrapped($var) - { - $this->writeWrapperValue("enabled", $var); - return $this;} - - /** - * Record of the creation of this channel. - * - * Generated from protobuf field .google.monitoring.v3.MutationRecord creation_record = 12; - * @return \Google\Cloud\Monitoring\V3\MutationRecord|null - */ - public function getCreationRecord() - { - return $this->creation_record; - } - - public function hasCreationRecord() - { - return isset($this->creation_record); - } - - public function clearCreationRecord() - { - unset($this->creation_record); - } - - /** - * Record of the creation of this channel. - * - * Generated from protobuf field .google.monitoring.v3.MutationRecord creation_record = 12; - * @param \Google\Cloud\Monitoring\V3\MutationRecord $var - * @return $this - */ - public function setCreationRecord($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\MutationRecord::class); - $this->creation_record = $var; - - return $this; - } - - /** - * Records of the modification of this channel. - * - * Generated from protobuf field repeated .google.monitoring.v3.MutationRecord mutation_records = 13; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getMutationRecords() - { - return $this->mutation_records; - } - - /** - * Records of the modification of this channel. - * - * Generated from protobuf field repeated .google.monitoring.v3.MutationRecord mutation_records = 13; - * @param \Google\Cloud\Monitoring\V3\MutationRecord[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setMutationRecords($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\MutationRecord::class); - $this->mutation_records = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/NotificationChannel/VerificationStatus.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/NotificationChannel/VerificationStatus.php 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 d7bee5fa72b..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 \Google\Api\LabelDescriptor[]|\Google\Protobuf\Internal\RepeatedField $labels - * The set of labels that must be defined to identify a particular - * channel of the corresponding type. Each label includes a - * description for how that field should be populated. - * @type int[]|\Google\Protobuf\Internal\RepeatedField $supported_tiers - * The tiers that support this notification channel; the project service tier - * must be one of the supported_tiers. - * @type int $launch_stage - * The product launch stage for channels of this type. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\Notification::initOnce(); - parent::__construct($data); - } - - /** - * The full REST resource name for this descriptor. The format is: - * projects/[PROJECT_ID_OR_NUMBER]/notificationChannelDescriptors/[TYPE] - * In the above, `[TYPE]` is the value of the `type` field. - * - * Generated from protobuf field string name = 6; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The full REST resource name for this descriptor. The format is: - * projects/[PROJECT_ID_OR_NUMBER]/notificationChannelDescriptors/[TYPE] - * In the above, `[TYPE]` is the value of the `type` field. - * - * Generated from protobuf field string name = 6; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The type of notification channel, such as "email" and "sms". To view the - * full list of channels, see - * [Channel - * descriptors](https://cloud.google.com/monitoring/alerts/using-channels-api#ncd). - * Notification channel types are globally unique. - * - * Generated from protobuf field string type = 1; - * @return string - */ - public function getType() - { - return $this->type; - } - - /** - * The type of notification channel, such as "email" and "sms". To view the - * full list of channels, see - * [Channel - * descriptors](https://cloud.google.com/monitoring/alerts/using-channels-api#ncd). - * Notification channel types are globally unique. - * - * Generated from protobuf field string type = 1; - * @param string $var - * @return $this - */ - public function setType($var) - { - GPBUtil::checkString($var, True); - $this->type = $var; - - return $this; - } - - /** - * A human-readable name for the notification channel type. This - * form of the name is suitable for a user interface. - * - * Generated from protobuf field string display_name = 2; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * A human-readable name for the notification channel type. This - * form of the name is suitable for a user interface. - * - * Generated from protobuf field string display_name = 2; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - - /** - * A human-readable description of the notification channel - * type. The description may include a description of the properties - * of the channel and pointers to external documentation. - * - * Generated from protobuf field string description = 3; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * A human-readable description of the notification channel - * type. The description may include a description of the properties - * of the channel and pointers to external documentation. - * - * Generated from protobuf field string description = 3; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * The set of labels that must be defined to identify a particular - * channel of the corresponding type. Each label includes a - * description for how that field should be populated. - * - * Generated from protobuf field repeated .google.api.LabelDescriptor labels = 4; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * The set of labels that must be defined to identify a particular - * channel of the corresponding type. Each label includes a - * description for how that field should be populated. - * - * Generated from protobuf field repeated .google.api.LabelDescriptor labels = 4; - * @param \Google\Api\LabelDescriptor[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setLabels($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Api\LabelDescriptor::class); - $this->labels = $arr; - - return $this; - } - - /** - * The tiers that support this notification channel; the project service tier - * must be one of the supported_tiers. - * - * Generated from protobuf field repeated .google.monitoring.v3.ServiceTier supported_tiers = 5 [deprecated = true]; - * @return \Google\Protobuf\Internal\RepeatedField - * @deprecated - */ - public function getSupportedTiers() - { - @trigger_error('supported_tiers is deprecated.', E_USER_DEPRECATED); - return $this->supported_tiers; - } - - /** - * The tiers that support this notification channel; the project service tier - * must be one of the supported_tiers. - * - * Generated from protobuf field repeated .google.monitoring.v3.ServiceTier supported_tiers = 5 [deprecated = true]; - * @param int[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - * @deprecated - */ - public function setSupportedTiers($var) - { - @trigger_error('supported_tiers is deprecated.', E_USER_DEPRECATED); - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\Monitoring\V3\ServiceTier::class); - $this->supported_tiers = $arr; - - return $this; - } - - /** - * The product launch stage for channels of this type. - * - * Generated from protobuf field .google.api.LaunchStage launch_stage = 7; - * @return int - */ - public function getLaunchStage() - { - return $this->launch_stage; - } - - /** - * The product launch stage for channels of this type. - * - * Generated from protobuf field .google.api.LaunchStage launch_stage = 7; - * @param int $var - * @return $this - */ - public function setLaunchStage($var) - { - GPBUtil::checkEnum($var, \Google\Api\LaunchStage::class); - $this->launch_stage = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/NotificationChannelServiceGrpcClient.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/NotificationChannelServiceGrpcClient.php deleted file mode 100644 index 9625fbee53c..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/NotificationChannelServiceGrpcClient.php +++ /dev/null @@ -1,217 +0,0 @@ -_simpleRequest('/google.monitoring.v3.NotificationChannelService/ListNotificationChannelDescriptors', - $argument, - ['\Google\Cloud\Monitoring\V3\ListNotificationChannelDescriptorsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets a single channel descriptor. The descriptor indicates which fields - * are expected / permitted for a notification channel of the given type. - * @param \Google\Cloud\Monitoring\V3\GetNotificationChannelDescriptorRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetNotificationChannelDescriptor(\Google\Cloud\Monitoring\V3\GetNotificationChannelDescriptorRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.monitoring.v3.NotificationChannelService/GetNotificationChannelDescriptor', - $argument, - ['\Google\Cloud\Monitoring\V3\NotificationChannelDescriptor', 'decode'], - $metadata, $options); - } - - /** - * Lists the notification channels that have been created for the project. - * @param \Google\Cloud\Monitoring\V3\ListNotificationChannelsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListNotificationChannels(\Google\Cloud\Monitoring\V3\ListNotificationChannelsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.monitoring.v3.NotificationChannelService/ListNotificationChannels', - $argument, - ['\Google\Cloud\Monitoring\V3\ListNotificationChannelsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets a single notification channel. The channel includes the relevant - * configuration details with which the channel was created. However, the - * response may truncate or omit passwords, API keys, or other private key - * matter and thus the response may not be 100% identical to the information - * that was supplied in the call to the create method. - * @param \Google\Cloud\Monitoring\V3\GetNotificationChannelRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetNotificationChannel(\Google\Cloud\Monitoring\V3\GetNotificationChannelRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.monitoring.v3.NotificationChannelService/GetNotificationChannel', - $argument, - ['\Google\Cloud\Monitoring\V3\NotificationChannel', 'decode'], - $metadata, $options); - } - - /** - * Creates a new notification channel, representing a single notification - * endpoint such as an email address, SMS number, or PagerDuty service. - * @param \Google\Cloud\Monitoring\V3\CreateNotificationChannelRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateNotificationChannel(\Google\Cloud\Monitoring\V3\CreateNotificationChannelRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.monitoring.v3.NotificationChannelService/CreateNotificationChannel', - $argument, - ['\Google\Cloud\Monitoring\V3\NotificationChannel', 'decode'], - $metadata, $options); - } - - /** - * Updates a notification channel. Fields not specified in the field mask - * remain unchanged. - * @param \Google\Cloud\Monitoring\V3\UpdateNotificationChannelRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateNotificationChannel(\Google\Cloud\Monitoring\V3\UpdateNotificationChannelRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.monitoring.v3.NotificationChannelService/UpdateNotificationChannel', - $argument, - ['\Google\Cloud\Monitoring\V3\NotificationChannel', 'decode'], - $metadata, $options); - } - - /** - * Deletes a notification channel. - * @param \Google\Cloud\Monitoring\V3\DeleteNotificationChannelRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteNotificationChannel(\Google\Cloud\Monitoring\V3\DeleteNotificationChannelRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.monitoring.v3.NotificationChannelService/DeleteNotificationChannel', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - - /** - * Causes a verification code to be delivered to the channel. The code - * can then be supplied in `VerifyNotificationChannel` to verify the channel. - * @param \Google\Cloud\Monitoring\V3\SendNotificationChannelVerificationCodeRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function SendNotificationChannelVerificationCode(\Google\Cloud\Monitoring\V3\SendNotificationChannelVerificationCodeRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.monitoring.v3.NotificationChannelService/SendNotificationChannelVerificationCode', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - - /** - * Requests a verification code for an already verified channel that can then - * be used in a call to VerifyNotificationChannel() on a different channel - * with an equivalent identity in the same or in a different project. This - * makes it possible to copy a channel between projects without requiring - * manual reverification of the channel. If the channel is not in the - * verified state, this method will fail (in other words, this may only be - * used if the SendNotificationChannelVerificationCode and - * VerifyNotificationChannel paths have already been used to put the given - * channel into the verified state). - * - * There is no guarantee that the verification codes returned by this method - * will be of a similar structure or form as the ones that are delivered - * to the channel via SendNotificationChannelVerificationCode; while - * VerifyNotificationChannel() will recognize both the codes delivered via - * SendNotificationChannelVerificationCode() and returned from - * GetNotificationChannelVerificationCode(), it is typically the case that - * the verification codes delivered via - * SendNotificationChannelVerificationCode() will be shorter and also - * have a shorter expiration (e.g. codes such as "G-123456") whereas - * GetVerificationCode() will typically return a much longer, websafe base - * 64 encoded string that has a longer expiration time. - * @param \Google\Cloud\Monitoring\V3\GetNotificationChannelVerificationCodeRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetNotificationChannelVerificationCode(\Google\Cloud\Monitoring\V3\GetNotificationChannelVerificationCodeRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.monitoring.v3.NotificationChannelService/GetNotificationChannelVerificationCode', - $argument, - ['\Google\Cloud\Monitoring\V3\GetNotificationChannelVerificationCodeResponse', 'decode'], - $metadata, $options); - } - - /** - * Verifies a `NotificationChannel` by proving receipt of the code - * delivered to the channel as a result of calling - * `SendNotificationChannelVerificationCode`. - * @param \Google\Cloud\Monitoring\V3\VerifyNotificationChannelRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function VerifyNotificationChannel(\Google\Cloud\Monitoring\V3\VerifyNotificationChannelRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.monitoring.v3.NotificationChannelService/VerifyNotificationChannel', - $argument, - ['\Google\Cloud\Monitoring\V3\NotificationChannel', 'decode'], - $metadata, $options); - } - -} diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/NotificationChannel_VerificationStatus.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/NotificationChannel_VerificationStatus.php deleted file mode 100644 index 86f961f17d0..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/NotificationChannel_VerificationStatus.php +++ /dev/null @@ -1,16 +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 7737c20a353..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 \Google\Cloud\Monitoring\V3\QueryError[]|\Google\Protobuf\Internal\RepeatedField $errors - * Errors in parsing the time series query language text. The number of errors - * in the response may be limited. - * @type string $error_summary - * A summary of all the errors. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\MetricService::initOnce(); - parent::__construct($data); - } - - /** - * Errors in parsing the time series query language text. The number of errors - * in the response may be limited. - * - * Generated from protobuf field repeated .google.monitoring.v3.QueryError errors = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getErrors() - { - return $this->errors; - } - - /** - * Errors in parsing the time series query language text. The number of errors - * in the response may be limited. - * - * Generated from protobuf field repeated .google.monitoring.v3.QueryError errors = 1; - * @param \Google\Cloud\Monitoring\V3\QueryError[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setErrors($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\QueryError::class); - $this->errors = $arr; - - return $this; - } - - /** - * A summary of all the errors. - * - * Generated from protobuf field string error_summary = 2; - * @return string - */ - public function getErrorSummary() - { - return $this->error_summary; - } - - /** - * A summary of all the errors. - * - * Generated from protobuf field string error_summary = 2; - * @param string $var - * @return $this - */ - public function setErrorSummary($var) - { - GPBUtil::checkString($var, True); - $this->error_summary = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/QueryTimeSeriesRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/QueryTimeSeriesRequest.php deleted file mode 100644 index aa0c8a189c1..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/QueryTimeSeriesRequest.php +++ /dev/null @@ -1,193 +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 03893547442..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 \Google\Cloud\Monitoring\V3\TimeSeriesData[]|\Google\Protobuf\Internal\RepeatedField $time_series_data - * The time series data. - * @type string $next_page_token - * If there are more results than have been returned, then this field is set - * to a non-empty value. To see the additional results, use that value as - * `page_token` in the next call to this method. - * @type \Google\Rpc\Status[]|\Google\Protobuf\Internal\RepeatedField $partial_errors - * Query execution errors that may have caused the time series data returned - * to be incomplete. The available data will be available in the - * response. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\MetricService::initOnce(); - parent::__construct($data); - } - - /** - * The descriptor for the time series data. - * - * Generated from protobuf field .google.monitoring.v3.TimeSeriesDescriptor time_series_descriptor = 8; - * @return \Google\Cloud\Monitoring\V3\TimeSeriesDescriptor|null - */ - public function getTimeSeriesDescriptor() - { - return $this->time_series_descriptor; - } - - public function hasTimeSeriesDescriptor() - { - return isset($this->time_series_descriptor); - } - - public function clearTimeSeriesDescriptor() - { - unset($this->time_series_descriptor); - } - - /** - * The descriptor for the time series data. - * - * Generated from protobuf field .google.monitoring.v3.TimeSeriesDescriptor time_series_descriptor = 8; - * @param \Google\Cloud\Monitoring\V3\TimeSeriesDescriptor $var - * @return $this - */ - public function setTimeSeriesDescriptor($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\TimeSeriesDescriptor::class); - $this->time_series_descriptor = $var; - - return $this; - } - - /** - * The time series data. - * - * Generated from protobuf field repeated .google.monitoring.v3.TimeSeriesData time_series_data = 9; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getTimeSeriesData() - { - return $this->time_series_data; - } - - /** - * The time series data. - * - * Generated from protobuf field repeated .google.monitoring.v3.TimeSeriesData time_series_data = 9; - * @param \Google\Cloud\Monitoring\V3\TimeSeriesData[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setTimeSeriesData($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\TimeSeriesData::class); - $this->time_series_data = $arr; - - return $this; - } - - /** - * If there are more results than have been returned, then this field is set - * to a non-empty value. To see the additional results, use that value as - * `page_token` in the next call to this method. - * - * Generated from protobuf field string next_page_token = 10; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * If there are more results than have been returned, then this field is set - * to a non-empty value. To see the additional results, use that value as - * `page_token` in the next call to this method. - * - * Generated from protobuf field string next_page_token = 10; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - - /** - * Query execution errors that may have caused the time series data returned - * to be incomplete. The available data will be available in the - * response. - * - * Generated from protobuf field repeated .google.rpc.Status partial_errors = 11; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getPartialErrors() - { - return $this->partial_errors; - } - - /** - * Query execution errors that may have caused the time series data returned - * to be incomplete. The available data will be available in the - * response. - * - * Generated from protobuf field repeated .google.rpc.Status partial_errors = 11; - * @param \Google\Rpc\Status[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setPartialErrors($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Rpc\Status::class); - $this->partial_errors = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Range.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Range.php 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 97fba93c165..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/SendNotificationChannelVerificationCodeRequest.php +++ /dev/null @@ -1,67 +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 = ''; - - /** - * 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/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/ServiceLevelObjective_View.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ServiceLevelObjective_View.php deleted file mode 100644 index dd79000ff9e..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ServiceLevelObjective_View.php +++ /dev/null @@ -1,16 +0,0 @@ -_simpleRequest('/google.monitoring.v3.ServiceMonitoringService/CreateService', - $argument, - ['\Google\Cloud\Monitoring\V3\Service', 'decode'], - $metadata, $options); - } - - /** - * Get the named `Service`. - * @param \Google\Cloud\Monitoring\V3\GetServiceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetService(\Google\Cloud\Monitoring\V3\GetServiceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.monitoring.v3.ServiceMonitoringService/GetService', - $argument, - ['\Google\Cloud\Monitoring\V3\Service', 'decode'], - $metadata, $options); - } - - /** - * List `Service`s for this workspace. - * @param \Google\Cloud\Monitoring\V3\ListServicesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListServices(\Google\Cloud\Monitoring\V3\ListServicesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.monitoring.v3.ServiceMonitoringService/ListServices', - $argument, - ['\Google\Cloud\Monitoring\V3\ListServicesResponse', 'decode'], - $metadata, $options); - } - - /** - * Update this `Service`. - * @param \Google\Cloud\Monitoring\V3\UpdateServiceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateService(\Google\Cloud\Monitoring\V3\UpdateServiceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.monitoring.v3.ServiceMonitoringService/UpdateService', - $argument, - ['\Google\Cloud\Monitoring\V3\Service', 'decode'], - $metadata, $options); - } - - /** - * Soft delete this `Service`. - * @param \Google\Cloud\Monitoring\V3\DeleteServiceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteService(\Google\Cloud\Monitoring\V3\DeleteServiceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.monitoring.v3.ServiceMonitoringService/DeleteService', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - - /** - * Create a `ServiceLevelObjective` for the given `Service`. - * @param \Google\Cloud\Monitoring\V3\CreateServiceLevelObjectiveRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateServiceLevelObjective(\Google\Cloud\Monitoring\V3\CreateServiceLevelObjectiveRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.monitoring.v3.ServiceMonitoringService/CreateServiceLevelObjective', - $argument, - ['\Google\Cloud\Monitoring\V3\ServiceLevelObjective', 'decode'], - $metadata, $options); - } - - /** - * Get a `ServiceLevelObjective` by name. - * @param \Google\Cloud\Monitoring\V3\GetServiceLevelObjectiveRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetServiceLevelObjective(\Google\Cloud\Monitoring\V3\GetServiceLevelObjectiveRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.monitoring.v3.ServiceMonitoringService/GetServiceLevelObjective', - $argument, - ['\Google\Cloud\Monitoring\V3\ServiceLevelObjective', 'decode'], - $metadata, $options); - } - - /** - * List the `ServiceLevelObjective`s for the given `Service`. - * @param \Google\Cloud\Monitoring\V3\ListServiceLevelObjectivesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListServiceLevelObjectives(\Google\Cloud\Monitoring\V3\ListServiceLevelObjectivesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.monitoring.v3.ServiceMonitoringService/ListServiceLevelObjectives', - $argument, - ['\Google\Cloud\Monitoring\V3\ListServiceLevelObjectivesResponse', 'decode'], - $metadata, $options); - } - - /** - * Update the given `ServiceLevelObjective`. - * @param \Google\Cloud\Monitoring\V3\UpdateServiceLevelObjectiveRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateServiceLevelObjective(\Google\Cloud\Monitoring\V3\UpdateServiceLevelObjectiveRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.monitoring.v3.ServiceMonitoringService/UpdateServiceLevelObjective', - $argument, - ['\Google\Cloud\Monitoring\V3\ServiceLevelObjective', 'decode'], - $metadata, $options); - } - - /** - * Delete the given `ServiceLevelObjective`. - * @param \Google\Cloud\Monitoring\V3\DeleteServiceLevelObjectiveRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteServiceLevelObjective(\Google\Cloud\Monitoring\V3\DeleteServiceLevelObjectiveRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.monitoring.v3.ServiceMonitoringService/DeleteServiceLevelObjective', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - -} diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ServiceTier.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ServiceTier.php deleted file mode 100644 index 36bc80c2aed..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/ServiceTier.php +++ /dev/null @@ -1,73 +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 Stackdriver Basic tier, a free tier of service that provides basic - * features, a moderate allotment of logs, and access to built-in metrics. - * A number of features are not available in this tier. For more details, - * see [the service tiers - * documentation](https://cloud.google.com/monitoring/workspaces/tiers). - * - * Generated from protobuf enum SERVICE_TIER_BASIC = 1; - */ - const SERVICE_TIER_BASIC = 1; - /** - * The Stackdriver Premium tier, a higher, more expensive tier of service - * that provides access to all Stackdriver features, lets you use Stackdriver - * with AWS accounts, and has a larger allotments for logs and metrics. For - * more details, see [the service tiers - * documentation](https://cloud.google.com/monitoring/workspaces/tiers). - * - * Generated from protobuf enum SERVICE_TIER_PREMIUM = 2; - */ - const SERVICE_TIER_PREMIUM = 2; - - private static $valueToName = [ - self::SERVICE_TIER_UNSPECIFIED => 'SERVICE_TIER_UNSPECIFIED', - self::SERVICE_TIER_BASIC => 'SERVICE_TIER_BASIC', - self::SERVICE_TIER_PREMIUM => 'SERVICE_TIER_PREMIUM', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service_AppEngine.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service_AppEngine.php deleted file mode 100644 index 1585ca5cde3..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/Service_AppEngine.php +++ /dev/null @@ -1,16 +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/TextLocator_Position.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TextLocator_Position.php deleted file mode 100644 index 843dc4d7ecd..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TextLocator_Position.php +++ /dev/null @@ -1,16 +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 0c30200025a..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 \Google\Cloud\Monitoring\V3\Point[]|\Google\Protobuf\Internal\RepeatedField $points - * The data points of this time series. When listing time series, points are - * returned in reverse time order. - * When creating a time series, this field must contain exactly one point and - * the point's type must be the same as the value type of the associated - * metric. If the associated metric's descriptor must be auto-created, then - * the value type of the descriptor is determined by the point's type, which - * must be `BOOL`, `INT64`, `DOUBLE`, or `DISTRIBUTION`. - * @type string $unit - * The units in which the metric value is reported. It is only applicable - * if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit` - * defines the representation of the stored metric values. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\Metric::initOnce(); - parent::__construct($data); - } - - /** - * The associated metric. A fully-specified metric used to identify the time - * series. - * - * Generated from protobuf field .google.api.Metric metric = 1; - * @return \Google\Api\Metric|null - */ - public function getMetric() - { - return $this->metric; - } - - public function hasMetric() - { - return isset($this->metric); - } - - public function clearMetric() - { - unset($this->metric); - } - - /** - * The associated metric. A fully-specified metric used to identify the time - * series. - * - * Generated from protobuf field .google.api.Metric metric = 1; - * @param \Google\Api\Metric $var - * @return $this - */ - public function setMetric($var) - { - GPBUtil::checkMessage($var, \Google\Api\Metric::class); - $this->metric = $var; - - return $this; - } - - /** - * The associated monitored resource. Custom metrics can use only certain - * monitored resource types in their time series data. For more information, - * see [Monitored resources for custom - * metrics](https://cloud.google.com/monitoring/custom-metrics/creating-metrics#custom-metric-resources). - * - * Generated from protobuf field .google.api.MonitoredResource resource = 2; - * @return \Google\Api\MonitoredResource|null - */ - public function getResource() - { - return $this->resource; - } - - public function hasResource() - { - return isset($this->resource); - } - - public function clearResource() - { - unset($this->resource); - } - - /** - * The associated monitored resource. Custom metrics can use only certain - * monitored resource types in their time series data. For more information, - * see [Monitored resources for custom - * metrics](https://cloud.google.com/monitoring/custom-metrics/creating-metrics#custom-metric-resources). - * - * Generated from protobuf field .google.api.MonitoredResource resource = 2; - * @param \Google\Api\MonitoredResource $var - * @return $this - */ - public function setResource($var) - { - GPBUtil::checkMessage($var, \Google\Api\MonitoredResource::class); - $this->resource = $var; - - return $this; - } - - /** - * Output only. The associated monitored resource metadata. When reading a - * time series, this field will include metadata labels that are explicitly - * named in the reduction. When creating a time series, this field is ignored. - * - * Generated from protobuf field .google.api.MonitoredResourceMetadata metadata = 7; - * @return \Google\Api\MonitoredResourceMetadata|null - */ - public function getMetadata() - { - return $this->metadata; - } - - public function hasMetadata() - { - return isset($this->metadata); - } - - public function clearMetadata() - { - unset($this->metadata); - } - - /** - * Output only. The associated monitored resource metadata. When reading a - * time series, this field will include metadata labels that are explicitly - * named in the reduction. When creating a time series, this field is ignored. - * - * Generated from protobuf field .google.api.MonitoredResourceMetadata metadata = 7; - * @param \Google\Api\MonitoredResourceMetadata $var - * @return $this - */ - public function setMetadata($var) - { - GPBUtil::checkMessage($var, \Google\Api\MonitoredResourceMetadata::class); - $this->metadata = $var; - - return $this; - } - - /** - * The metric kind of the time series. When listing time series, this metric - * kind might be different from the metric kind of the associated metric if - * this time series is an alignment or reduction of other time series. - * When creating a time series, this field is optional. If present, it must be - * the same as the metric kind of the associated metric. If the associated - * metric's descriptor must be auto-created, then this field specifies the - * metric kind of the new descriptor and must be either `GAUGE` (the default) - * or `CUMULATIVE`. - * - * Generated from protobuf field .google.api.MetricDescriptor.MetricKind metric_kind = 3; - * @return int - */ - public function getMetricKind() - { - return $this->metric_kind; - } - - /** - * The metric kind of the time series. When listing time series, this metric - * kind might be different from the metric kind of the associated metric if - * this time series is an alignment or reduction of other time series. - * When creating a time series, this field is optional. If present, it must be - * the same as the metric kind of the associated metric. If the associated - * metric's descriptor must be auto-created, then this field specifies the - * metric kind of the new descriptor and must be either `GAUGE` (the default) - * or `CUMULATIVE`. - * - * Generated from protobuf field .google.api.MetricDescriptor.MetricKind metric_kind = 3; - * @param int $var - * @return $this - */ - public function setMetricKind($var) - { - GPBUtil::checkEnum($var, \Google\Api\MetricDescriptor\MetricKind::class); - $this->metric_kind = $var; - - return $this; - } - - /** - * The value type of the time series. When listing time series, this value - * type might be different from the value type of the associated metric if - * this time series is an alignment or reduction of other time series. - * When creating a time series, this field is optional. If present, it must be - * the same as the type of the data in the `points` field. - * - * Generated from protobuf field .google.api.MetricDescriptor.ValueType value_type = 4; - * @return int - */ - public function getValueType() - { - return $this->value_type; - } - - /** - * The value type of the time series. When listing time series, this value - * type might be different from the value type of the associated metric if - * this time series is an alignment or reduction of other time series. - * When creating a time series, this field is optional. If present, it must be - * the same as the type of the data in the `points` field. - * - * Generated from protobuf field .google.api.MetricDescriptor.ValueType value_type = 4; - * @param int $var - * @return $this - */ - public function setValueType($var) - { - GPBUtil::checkEnum($var, \Google\Api\MetricDescriptor\ValueType::class); - $this->value_type = $var; - - return $this; - } - - /** - * The data points of this time series. When listing time series, points are - * returned in reverse time order. - * When creating a time series, this field must contain exactly one point and - * the point's type must be the same as the value type of the associated - * metric. If the associated metric's descriptor must be auto-created, then - * the value type of the descriptor is determined by the point's type, which - * must be `BOOL`, `INT64`, `DOUBLE`, or `DISTRIBUTION`. - * - * Generated from protobuf field repeated .google.monitoring.v3.Point points = 5; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getPoints() - { - return $this->points; - } - - /** - * The data points of this time series. When listing time series, points are - * returned in reverse time order. - * When creating a time series, this field must contain exactly one point and - * the point's type must be the same as the value type of the associated - * metric. If the associated metric's descriptor must be auto-created, then - * the value type of the descriptor is determined by the point's type, which - * must be `BOOL`, `INT64`, `DOUBLE`, or `DISTRIBUTION`. - * - * Generated from protobuf field repeated .google.monitoring.v3.Point points = 5; - * @param \Google\Cloud\Monitoring\V3\Point[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setPoints($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\Point::class); - $this->points = $arr; - - return $this; - } - - /** - * The units in which the metric value is reported. It is only applicable - * if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit` - * defines the representation of the stored metric values. - * - * Generated from protobuf field string unit = 8; - * @return string - */ - public function getUnit() - { - return $this->unit; - } - - /** - * The units in which the metric value is reported. It is only applicable - * if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit` - * defines the representation of the stored metric values. - * - * Generated from protobuf field string unit = 8; - * @param string $var - * @return $this - */ - public function setUnit($var) - { - GPBUtil::checkString($var, True); - $this->unit = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesData.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesData.php deleted file mode 100644 index a7c17adaf21..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 \Google\Cloud\Monitoring\V3\LabelValue[]|\Google\Protobuf\Internal\RepeatedField $label_values - * The values of the labels in the time series identifier, given in the same - * order as the `label_descriptors` field of the TimeSeriesDescriptor - * associated with this object. Each value must have a value of the type - * given in the corresponding entry of `label_descriptors`. - * @type \Google\Cloud\Monitoring\V3\TimeSeriesData\PointData[]|\Google\Protobuf\Internal\RepeatedField $point_data - * The points in the time series. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\Metric::initOnce(); - parent::__construct($data); - } - - /** - * The values of the labels in the time series identifier, given in the same - * order as the `label_descriptors` field of the TimeSeriesDescriptor - * associated with this object. Each value must have a value of the type - * given in the corresponding entry of `label_descriptors`. - * - * Generated from protobuf field repeated .google.monitoring.v3.LabelValue label_values = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getLabelValues() - { - return $this->label_values; - } - - /** - * The values of the labels in the time series identifier, given in the same - * order as the `label_descriptors` field of the TimeSeriesDescriptor - * associated with this object. Each value must have a value of the type - * given in the corresponding entry of `label_descriptors`. - * - * Generated from protobuf field repeated .google.monitoring.v3.LabelValue label_values = 1; - * @param \Google\Cloud\Monitoring\V3\LabelValue[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setLabelValues($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\LabelValue::class); - $this->label_values = $arr; - - return $this; - } - - /** - * The points in the time series. - * - * Generated from protobuf field repeated .google.monitoring.v3.TimeSeriesData.PointData point_data = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getPointData() - { - return $this->point_data; - } - - /** - * The points in the time series. - * - * Generated from protobuf field repeated .google.monitoring.v3.TimeSeriesData.PointData point_data = 2; - * @param \Google\Cloud\Monitoring\V3\TimeSeriesData\PointData[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setPointData($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\TimeSeriesData\PointData::class); - $this->point_data = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesData/PointData.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesData/PointData.php deleted file mode 100644 index 8556054007e..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 \Google\Cloud\Monitoring\V3\TypedValue[]|\Google\Protobuf\Internal\RepeatedField $values - * The values that make up the point. - * @type \Google\Cloud\Monitoring\V3\TimeInterval $time_interval - * The time interval associated with the point. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\Metric::initOnce(); - parent::__construct($data); - } - - /** - * The values that make up the point. - * - * Generated from protobuf field repeated .google.monitoring.v3.TypedValue values = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getValues() - { - return $this->values; - } - - /** - * The values that make up the point. - * - * Generated from protobuf field repeated .google.monitoring.v3.TypedValue values = 1; - * @param \Google\Cloud\Monitoring\V3\TypedValue[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setValues($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\TypedValue::class); - $this->values = $arr; - - return $this; - } - - /** - * The time interval associated with the point. - * - * Generated from protobuf field .google.monitoring.v3.TimeInterval time_interval = 2; - * @return \Google\Cloud\Monitoring\V3\TimeInterval|null - */ - public function getTimeInterval() - { - return $this->time_interval; - } - - public function hasTimeInterval() - { - return isset($this->time_interval); - } - - public function clearTimeInterval() - { - unset($this->time_interval); - } - - /** - * The time interval associated with the point. - * - * Generated from protobuf field .google.monitoring.v3.TimeInterval time_interval = 2; - * @param \Google\Cloud\Monitoring\V3\TimeInterval $var - * @return $this - */ - public function setTimeInterval($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\TimeInterval::class); - $this->time_interval = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(PointData::class, \Google\Cloud\Monitoring\V3\TimeSeriesData_PointData::class); - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesData_PointData.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesData_PointData.php deleted file mode 100644 index 99a46d794e2..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesData_PointData.php +++ /dev/null @@ -1,16 +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 \Google\Api\LabelDescriptor[]|\Google\Protobuf\Internal\RepeatedField $label_descriptors - * Descriptors for the labels. - * @type \Google\Cloud\Monitoring\V3\TimeSeriesDescriptor\ValueDescriptor[]|\Google\Protobuf\Internal\RepeatedField $point_descriptors - * Descriptors for the point data value columns. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\Metric::initOnce(); - parent::__construct($data); - } - - /** - * Descriptors for the labels. - * - * Generated from protobuf field repeated .google.api.LabelDescriptor label_descriptors = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getLabelDescriptors() - { - return $this->label_descriptors; - } - - /** - * Descriptors for the labels. - * - * Generated from protobuf field repeated .google.api.LabelDescriptor label_descriptors = 1; - * @param \Google\Api\LabelDescriptor[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setLabelDescriptors($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Api\LabelDescriptor::class); - $this->label_descriptors = $arr; - - return $this; - } - - /** - * Descriptors for the point data value columns. - * - * Generated from protobuf field repeated .google.monitoring.v3.TimeSeriesDescriptor.ValueDescriptor point_descriptors = 5; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getPointDescriptors() - { - return $this->point_descriptors; - } - - /** - * Descriptors for the point data value columns. - * - * Generated from protobuf field repeated .google.monitoring.v3.TimeSeriesDescriptor.ValueDescriptor point_descriptors = 5; - * @param \Google\Cloud\Monitoring\V3\TimeSeriesDescriptor\ValueDescriptor[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setPointDescriptors($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\TimeSeriesDescriptor\ValueDescriptor::class); - $this->point_descriptors = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesDescriptor/ValueDescriptor.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesDescriptor/ValueDescriptor.php 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/TimeSeriesDescriptor_ValueDescriptor.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesDescriptor_ValueDescriptor.php deleted file mode 100644 index 7b60dd89f54..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/TimeSeriesDescriptor_ValueDescriptor.php +++ /dev/null @@ -1,16 +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 397f15c3712..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateAlertPolicyRequest.php +++ /dev/null @@ -1,201 +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; - - /** - * 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 93d63e1a058..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateGroupRequest.php +++ /dev/null @@ -1,115 +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; - - /** - * 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 b5f96b344e4..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateNotificationChannelRequest.php +++ /dev/null @@ -1,133 +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; - - /** - * 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 94cceea14b7..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateServiceLevelObjectiveRequest.php +++ /dev/null @@ -1,125 +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; - - /** - * 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 f00dd6e38e1..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateServiceRequest.php +++ /dev/null @@ -1,125 +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; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Monitoring\V3\Service $service - * Required. The `Service` to draw updates from. - * The given `name` specifies the resource to update. - * @type \Google\Protobuf\FieldMask $update_mask - * A set of field paths defining which fields to use for the update. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\ServiceService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The `Service` to draw updates from. - * The given `name` specifies the resource to update. - * - * Generated from protobuf field .google.monitoring.v3.Service service = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Monitoring\V3\Service|null - */ - public function getService() - { - return $this->service; - } - - public function hasService() - { - return isset($this->service); - } - - public function clearService() - { - unset($this->service); - } - - /** - * Required. The `Service` to draw updates from. - * The given `name` specifies the resource to update. - * - * Generated from protobuf field .google.monitoring.v3.Service service = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Monitoring\V3\Service $var - * @return $this - */ - public function setService($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\Service::class); - $this->service = $var; - - return $this; - } - - /** - * A set of field paths defining which fields to use for the update. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @return \Google\Protobuf\FieldMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * A set of field paths defining which fields to use for the update. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateUptimeCheckConfigRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateUptimeCheckConfigRequest.php deleted file mode 100644 index 7df7c33fa94..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UpdateUptimeCheckConfigRequest.php +++ /dev/null @@ -1,169 +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 corresonding field is omitted in this partial Uptime check - * configuration, it has the effect of deleting/clearing the field from the - * configuration on the server. - * The following fields can be updated: `display_name`, - * `http_check`, `tcp_check`, `timeout`, `content_matchers`, and - * `selected_regions`. - * - * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig uptime_check_config = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $uptime_check_config = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\FieldMask $update_mask - * Optional. If present, only the listed fields in the current Uptime check - * configuration are updated with values from the new configuration. If this - * field is empty, then the current configuration is completely replaced with - * the new configuration. - * @type \Google\Cloud\Monitoring\V3\UptimeCheckConfig $uptime_check_config - * Required. If an `updateMask` has been specified, this field gives - * the values for the set of fields mentioned in the `updateMask`. If an - * `updateMask` has not been given, this Uptime check configuration replaces - * the current configuration. If a field is mentioned in `updateMask` but - * the corresonding field is omitted in this partial Uptime check - * configuration, it has the effect of deleting/clearing the field from the - * configuration on the server. - * The following fields can be updated: `display_name`, - * `http_check`, `tcp_check`, `timeout`, `content_matchers`, and - * `selected_regions`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\UptimeService::initOnce(); - parent::__construct($data); - } - - /** - * Optional. If present, only the listed fields in the current Uptime check - * configuration are updated with values from the new configuration. If this - * field is empty, then the current configuration is completely replaced with - * the new configuration. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @return \Google\Protobuf\FieldMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * Optional. If present, only the listed fields in the current Uptime check - * configuration are updated with values from the new configuration. If this - * field is empty, then the current configuration is completely replaced with - * the new configuration. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - - /** - * Required. If an `updateMask` has been specified, this field gives - * the values for the set of fields mentioned in the `updateMask`. If an - * `updateMask` has not been given, this Uptime check configuration replaces - * the current configuration. If a field is mentioned in `updateMask` but - * the corresonding field is omitted in this partial Uptime check - * configuration, it has the effect of deleting/clearing the field from the - * configuration on the server. - * The following fields can be updated: `display_name`, - * `http_check`, `tcp_check`, `timeout`, `content_matchers`, and - * `selected_regions`. - * - * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig uptime_check_config = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Monitoring\V3\UptimeCheckConfig|null - */ - public function getUptimeCheckConfig() - { - return $this->uptime_check_config; - } - - public function hasUptimeCheckConfig() - { - return isset($this->uptime_check_config); - } - - public function clearUptimeCheckConfig() - { - unset($this->uptime_check_config); - } - - /** - * Required. If an `updateMask` has been specified, this field gives - * the values for the set of fields mentioned in the `updateMask`. If an - * `updateMask` has not been given, this Uptime check configuration replaces - * the current configuration. If a field is mentioned in `updateMask` but - * the corresonding field is omitted in this partial Uptime check - * configuration, it has the effect of deleting/clearing the field from the - * configuration on the server. - * The following fields can be updated: `display_name`, - * `http_check`, `tcp_check`, `timeout`, `content_matchers`, and - * `selected_regions`. - * - * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig uptime_check_config = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Monitoring\V3\UptimeCheckConfig $var - * @return $this - */ - public function setUptimeCheckConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\UptimeCheckConfig::class); - $this->uptime_check_config = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig.php deleted file mode 100644 index d38c7fd929e..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig.php +++ /dev/null @@ -1,617 +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 Stackdriver Workspace in order to make it easier - * to identify; however, uniqueness is not enforced. Required. - * - * Generated from protobuf field string display_name = 2; - */ - protected $display_name = ''; - /** - * How often, in seconds, the Uptime check is performed. - * Currently, the only supported values are `60s` (1 minute), `300s` - * (5 minutes), `600s` (10 minutes), and `900s` (15 minutes). Optional, - * defaults to `60s`. - * - * Generated from protobuf field .google.protobuf.Duration period = 7; - */ - protected $period = null; - /** - * The maximum amount of time to wait for the request to complete (must be - * between 1 and 60 seconds). Required. - * - * Generated from protobuf field .google.protobuf.Duration timeout = 8; - */ - protected $timeout = null; - /** - * The content that is expected to appear in the data returned by the target - * server against which the check is run. Currently, only the first entry - * in the `content_matchers` list is supported, and additional entries will - * be ignored. This field is optional and should only be specified if a - * content match is required as part of the/ Uptime check. - * - * Generated from protobuf field repeated .google.monitoring.v3.UptimeCheckConfig.ContentMatcher content_matchers = 9; - */ - private $content_matchers; - /** - * The list of regions from which the check will be run. - * Some regions contain one location, and others contain more than one. - * If this field is specified, enough regions must be provided to include a - * minimum of 3 locations. Not specifying this field will result in Uptime - * checks running from all available regions. - * - * Generated from protobuf field repeated .google.monitoring.v3.UptimeCheckRegion selected_regions = 10; - */ - private $selected_regions; - /** - * If this is `true`, then checks are made only from the 'internal_checkers'. - * If it is `false`, then checks are made only from the 'selected_regions'. - * It is an error to provide 'selected_regions' when is_internal is `true`, - * or to provide 'internal_checkers' when is_internal is `false`. - * - * Generated from protobuf field bool is_internal = 15 [deprecated = true]; - * @deprecated - */ - protected $is_internal = false; - /** - * The internal checkers that this check will egress from. If `is_internal` is - * `true` and this list is empty, the check will egress from all the - * InternalCheckers configured for the project that owns this - * `UptimeCheckConfig`. - * - * Generated from protobuf field repeated .google.monitoring.v3.InternalChecker internal_checkers = 14 [deprecated = true]; - * @deprecated - */ - private $internal_checkers; - protected $resource; - protected $check_request_type; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * A unique resource name for this Uptime check configuration. The format is: - * projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID] - * `[PROJECT_ID_OR_NUMBER]` is the Workspace host project associated with the - * Uptime check. - * This field should be omitted when creating the Uptime check configuration; - * on create, the resource name is assigned by the server and included in the - * response. - * @type string $display_name - * A human-friendly name for the Uptime check configuration. The display name - * should be unique within a Stackdriver Workspace in order to make it easier - * to identify; however, uniqueness is not enforced. Required. - * @type \Google\Api\MonitoredResource $monitored_resource - * The [monitored - * resource](https://cloud.google.com/monitoring/api/resources) associated - * with the configuration. - * The following monitored resource types are valid for this field: - * `uptime_url`, - * `gce_instance`, - * `gae_app`, - * `aws_ec2_instance`, - * `aws_elb_load_balancer` - * `k8s_service` - * @type \Google\Cloud\Monitoring\V3\UptimeCheckConfig\ResourceGroup $resource_group - * The group resource associated with the configuration. - * @type \Google\Cloud\Monitoring\V3\UptimeCheckConfig\HttpCheck $http_check - * Contains information needed to make an HTTP or HTTPS check. - * @type \Google\Cloud\Monitoring\V3\UptimeCheckConfig\TcpCheck $tcp_check - * Contains information needed to make a TCP check. - * @type \Google\Protobuf\Duration $period - * How often, in seconds, the Uptime check is performed. - * Currently, the only supported values are `60s` (1 minute), `300s` - * (5 minutes), `600s` (10 minutes), and `900s` (15 minutes). Optional, - * defaults to `60s`. - * @type \Google\Protobuf\Duration $timeout - * The maximum amount of time to wait for the request to complete (must be - * between 1 and 60 seconds). Required. - * @type \Google\Cloud\Monitoring\V3\UptimeCheckConfig\ContentMatcher[]|\Google\Protobuf\Internal\RepeatedField $content_matchers - * The content that is expected to appear in the data returned by the target - * server against which the check is run. Currently, only the first entry - * in the `content_matchers` list is supported, and additional entries will - * be ignored. This field is optional and should only be specified if a - * content match is required as part of the/ Uptime check. - * @type int[]|\Google\Protobuf\Internal\RepeatedField $selected_regions - * The list of regions from which the check will be run. - * Some regions contain one location, and others contain more than one. - * If this field is specified, enough regions must be provided to include a - * minimum of 3 locations. Not specifying this field will result in Uptime - * checks running from all available regions. - * @type bool $is_internal - * If this is `true`, then checks are made only from the 'internal_checkers'. - * If it is `false`, then checks are made only from the 'selected_regions'. - * It is an error to provide 'selected_regions' when is_internal is `true`, - * or to provide 'internal_checkers' when is_internal is `false`. - * @type \Google\Cloud\Monitoring\V3\InternalChecker[]|\Google\Protobuf\Internal\RepeatedField $internal_checkers - * The internal checkers that this check will egress from. If `is_internal` is - * `true` and this list is empty, the check will egress from all the - * InternalCheckers configured for the project that owns this - * `UptimeCheckConfig`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\Uptime::initOnce(); - parent::__construct($data); - } - - /** - * A unique resource name for this Uptime check configuration. The format is: - * projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID] - * `[PROJECT_ID_OR_NUMBER]` is the Workspace host project associated with the - * Uptime check. - * This field should be omitted when creating the Uptime check configuration; - * on create, the resource name is assigned by the server and included in the - * response. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * A unique resource name for this Uptime check configuration. The format is: - * projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID] - * `[PROJECT_ID_OR_NUMBER]` is the Workspace host project associated with the - * Uptime check. - * This field should be omitted when creating the Uptime check configuration; - * on create, the resource name is assigned by the server and included in the - * response. - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * A human-friendly name for the Uptime check configuration. The display name - * should be unique within a Stackdriver Workspace in order to make it easier - * to identify; however, uniqueness is not enforced. Required. - * - * Generated from protobuf field string display_name = 2; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * A human-friendly name for the Uptime check configuration. The display name - * should be unique within a Stackdriver Workspace in order to make it easier - * to identify; however, uniqueness is not enforced. Required. - * - * Generated from protobuf field string display_name = 2; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - - /** - * The [monitored - * resource](https://cloud.google.com/monitoring/api/resources) associated - * with the configuration. - * The following monitored resource types are valid for this field: - * `uptime_url`, - * `gce_instance`, - * `gae_app`, - * `aws_ec2_instance`, - * `aws_elb_load_balancer` - * `k8s_service` - * - * Generated from protobuf field .google.api.MonitoredResource monitored_resource = 3; - * @return \Google\Api\MonitoredResource|null - */ - public function getMonitoredResource() - { - return $this->readOneof(3); - } - - public function hasMonitoredResource() - { - return $this->hasOneof(3); - } - - /** - * The [monitored - * resource](https://cloud.google.com/monitoring/api/resources) associated - * with the configuration. - * The following monitored resource types are valid for this field: - * `uptime_url`, - * `gce_instance`, - * `gae_app`, - * `aws_ec2_instance`, - * `aws_elb_load_balancer` - * `k8s_service` - * - * Generated from protobuf field .google.api.MonitoredResource monitored_resource = 3; - * @param \Google\Api\MonitoredResource $var - * @return $this - */ - public function setMonitoredResource($var) - { - GPBUtil::checkMessage($var, \Google\Api\MonitoredResource::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * The group resource associated with the configuration. - * - * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.ResourceGroup resource_group = 4; - * @return \Google\Cloud\Monitoring\V3\UptimeCheckConfig\ResourceGroup|null - */ - public function getResourceGroup() - { - return $this->readOneof(4); - } - - public function hasResourceGroup() - { - return $this->hasOneof(4); - } - - /** - * The group resource associated with the configuration. - * - * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.ResourceGroup resource_group = 4; - * @param \Google\Cloud\Monitoring\V3\UptimeCheckConfig\ResourceGroup $var - * @return $this - */ - public function setResourceGroup($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\UptimeCheckConfig\ResourceGroup::class); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * Contains information needed to make an HTTP or HTTPS check. - * - * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.HttpCheck http_check = 5; - * @return \Google\Cloud\Monitoring\V3\UptimeCheckConfig\HttpCheck|null - */ - public function getHttpCheck() - { - return $this->readOneof(5); - } - - public function hasHttpCheck() - { - return $this->hasOneof(5); - } - - /** - * Contains information needed to make an HTTP or HTTPS check. - * - * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.HttpCheck http_check = 5; - * @param \Google\Cloud\Monitoring\V3\UptimeCheckConfig\HttpCheck $var - * @return $this - */ - public function setHttpCheck($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\UptimeCheckConfig\HttpCheck::class); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * Contains information needed to make a TCP check. - * - * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.TcpCheck tcp_check = 6; - * @return \Google\Cloud\Monitoring\V3\UptimeCheckConfig\TcpCheck|null - */ - public function getTcpCheck() - { - return $this->readOneof(6); - } - - public function hasTcpCheck() - { - return $this->hasOneof(6); - } - - /** - * Contains information needed to make a TCP check. - * - * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.TcpCheck tcp_check = 6; - * @param \Google\Cloud\Monitoring\V3\UptimeCheckConfig\TcpCheck $var - * @return $this - */ - public function setTcpCheck($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\UptimeCheckConfig\TcpCheck::class); - $this->writeOneof(6, $var); - - return $this; - } - - /** - * How often, in seconds, the Uptime check is performed. - * Currently, the only supported values are `60s` (1 minute), `300s` - * (5 minutes), `600s` (10 minutes), and `900s` (15 minutes). Optional, - * defaults to `60s`. - * - * Generated from protobuf field .google.protobuf.Duration period = 7; - * @return \Google\Protobuf\Duration|null - */ - public function getPeriod() - { - return $this->period; - } - - public function hasPeriod() - { - return isset($this->period); - } - - public function clearPeriod() - { - unset($this->period); - } - - /** - * How often, in seconds, the Uptime check is performed. - * Currently, the only supported values are `60s` (1 minute), `300s` - * (5 minutes), `600s` (10 minutes), and `900s` (15 minutes). Optional, - * defaults to `60s`. - * - * Generated from protobuf field .google.protobuf.Duration period = 7; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setPeriod($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->period = $var; - - return $this; - } - - /** - * The maximum amount of time to wait for the request to complete (must be - * between 1 and 60 seconds). Required. - * - * Generated from protobuf field .google.protobuf.Duration timeout = 8; - * @return \Google\Protobuf\Duration|null - */ - public function getTimeout() - { - return $this->timeout; - } - - public function hasTimeout() - { - return isset($this->timeout); - } - - public function clearTimeout() - { - unset($this->timeout); - } - - /** - * The maximum amount of time to wait for the request to complete (must be - * between 1 and 60 seconds). Required. - * - * Generated from protobuf field .google.protobuf.Duration timeout = 8; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setTimeout($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->timeout = $var; - - return $this; - } - - /** - * The content that is expected to appear in the data returned by the target - * server against which the check is run. Currently, only the first entry - * in the `content_matchers` list is supported, and additional entries will - * be ignored. This field is optional and should only be specified if a - * content match is required as part of the/ Uptime check. - * - * Generated from protobuf field repeated .google.monitoring.v3.UptimeCheckConfig.ContentMatcher content_matchers = 9; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getContentMatchers() - { - return $this->content_matchers; - } - - /** - * The content that is expected to appear in the data returned by the target - * server against which the check is run. Currently, only the first entry - * in the `content_matchers` list is supported, and additional entries will - * be ignored. This field is optional and should only be specified if a - * content match is required as part of the/ Uptime check. - * - * Generated from protobuf field repeated .google.monitoring.v3.UptimeCheckConfig.ContentMatcher content_matchers = 9; - * @param \Google\Cloud\Monitoring\V3\UptimeCheckConfig\ContentMatcher[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setContentMatchers($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\UptimeCheckConfig\ContentMatcher::class); - $this->content_matchers = $arr; - - return $this; - } - - /** - * The list of regions from which the check will be run. - * Some regions contain one location, and others contain more than one. - * If this field is specified, enough regions must be provided to include a - * minimum of 3 locations. Not specifying this field will result in Uptime - * checks running from all available regions. - * - * Generated from protobuf field repeated .google.monitoring.v3.UptimeCheckRegion selected_regions = 10; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSelectedRegions() - { - return $this->selected_regions; - } - - /** - * The list of regions from which the check will be run. - * Some regions contain one location, and others contain more than one. - * If this field is specified, enough regions must be provided to include a - * minimum of 3 locations. Not specifying this field will result in Uptime - * checks running from all available regions. - * - * Generated from protobuf field repeated .google.monitoring.v3.UptimeCheckRegion selected_regions = 10; - * @param int[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSelectedRegions($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\Monitoring\V3\UptimeCheckRegion::class); - $this->selected_regions = $arr; - - return $this; - } - - /** - * If this is `true`, then checks are made only from the 'internal_checkers'. - * If it is `false`, then checks are made only from the 'selected_regions'. - * It is an error to provide 'selected_regions' when is_internal is `true`, - * or to provide 'internal_checkers' when is_internal is `false`. - * - * Generated from protobuf field bool is_internal = 15 [deprecated = true]; - * @return bool - * @deprecated - */ - public function getIsInternal() - { - @trigger_error('is_internal is deprecated.', E_USER_DEPRECATED); - return $this->is_internal; - } - - /** - * If this is `true`, then checks are made only from the 'internal_checkers'. - * If it is `false`, then checks are made only from the 'selected_regions'. - * It is an error to provide 'selected_regions' when is_internal is `true`, - * or to provide 'internal_checkers' when is_internal is `false`. - * - * Generated from protobuf field bool is_internal = 15 [deprecated = true]; - * @param bool $var - * @return $this - * @deprecated - */ - public function setIsInternal($var) - { - @trigger_error('is_internal is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkBool($var); - $this->is_internal = $var; - - return $this; - } - - /** - * The internal checkers that this check will egress from. If `is_internal` is - * `true` and this list is empty, the check will egress from all the - * InternalCheckers configured for the project that owns this - * `UptimeCheckConfig`. - * - * Generated from protobuf field repeated .google.monitoring.v3.InternalChecker internal_checkers = 14 [deprecated = true]; - * @return \Google\Protobuf\Internal\RepeatedField - * @deprecated - */ - public function getInternalCheckers() - { - @trigger_error('internal_checkers is deprecated.', E_USER_DEPRECATED); - return $this->internal_checkers; - } - - /** - * The internal checkers that this check will egress from. If `is_internal` is - * `true` and this list is empty, the check will egress from all the - * InternalCheckers configured for the project that owns this - * `UptimeCheckConfig`. - * - * Generated from protobuf field repeated .google.monitoring.v3.InternalChecker internal_checkers = 14 [deprecated = true]; - * @param \Google\Cloud\Monitoring\V3\InternalChecker[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - * @deprecated - */ - public function setInternalCheckers($var) - { - @trigger_error('internal_checkers is deprecated.', E_USER_DEPRECATED); - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Monitoring\V3\InternalChecker::class); - $this->internal_checkers = $arr; - - return $this; - } - - /** - * @return string - */ - public function getResource() - { - return $this->whichOneof("resource"); - } - - /** - * @return string - */ - public function getCheckRequestType() - { - return $this->whichOneof("check_request_type"); - } - -} - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/ContentMatcher.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/ContentMatcher.php deleted file mode 100644 index 3d662c990c6..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/ContentMatcher.php +++ /dev/null @@ -1,116 +0,0 @@ -google.monitoring.v3.UptimeCheckConfig.ContentMatcher - */ -class ContentMatcher extends \Google\Protobuf\Internal\Message -{ - /** - * String or regex content to match. Maximum 1024 bytes. An empty `content` - * string indicates no content matching is to be performed. - * - * Generated from protobuf field string content = 1; - */ - protected $content = ''; - /** - * The type of content matcher that will be applied to the server output, - * compared to the `content` string when the check is run. - * - * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.ContentMatcher.ContentMatcherOption matcher = 2; - */ - protected $matcher = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $content - * String or regex content to match. Maximum 1024 bytes. An empty `content` - * string indicates no content matching is to be performed. - * @type int $matcher - * The type of content matcher that will be applied to the server output, - * compared to the `content` string when the check is run. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\Uptime::initOnce(); - parent::__construct($data); - } - - /** - * String or regex content to match. Maximum 1024 bytes. An empty `content` - * string indicates no content matching is to be performed. - * - * Generated from protobuf field string content = 1; - * @return string - */ - public function getContent() - { - return $this->content; - } - - /** - * String or regex content to match. Maximum 1024 bytes. An empty `content` - * string indicates no content matching is to be performed. - * - * Generated from protobuf field string content = 1; - * @param string $var - * @return $this - */ - public function setContent($var) - { - GPBUtil::checkString($var, True); - $this->content = $var; - - return $this; - } - - /** - * The type of content matcher that will be applied to the server output, - * compared to the `content` string when the check is run. - * - * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.ContentMatcher.ContentMatcherOption matcher = 2; - * @return int - */ - public function getMatcher() - { - return $this->matcher; - } - - /** - * The type of content matcher that will be applied to the server output, - * compared to the `content` string when the check is run. - * - * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.ContentMatcher.ContentMatcherOption matcher = 2; - * @param int $var - * @return $this - */ - public function setMatcher($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\UptimeCheckConfig\ContentMatcher\ContentMatcherOption::class); - $this->matcher = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ContentMatcher::class, \Google\Cloud\Monitoring\V3\UptimeCheckConfig_ContentMatcher::class); - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/ContentMatcher/ContentMatcherOption.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/ContentMatcher/ContentMatcherOption.php deleted file mode 100644 index b2d900726d2..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/ContentMatcher/ContentMatcherOption.php +++ /dev/null @@ -1,89 +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 of the output - * matches the regular expression specified in the `content` string. - * Regex matching is only supported for HTTP/HTTPS checks. - * - * Generated from protobuf enum MATCHES_REGEX = 3; - */ - const MATCHES_REGEX = 3; - /** - * Selects negation of regular-expression matching. The match succeeds if - * the output does _NOT_ match the regular expression specified in the - * `content` string. Regex matching is only supported for HTTP/HTTPS - * checks. - * - * Generated from protobuf enum NOT_MATCHES_REGEX = 4; - */ - const NOT_MATCHES_REGEX = 4; - - private static $valueToName = [ - self::CONTENT_MATCHER_OPTION_UNSPECIFIED => 'CONTENT_MATCHER_OPTION_UNSPECIFIED', - self::CONTAINS_STRING => 'CONTAINS_STRING', - self::NOT_CONTAINS_STRING => 'NOT_CONTAINS_STRING', - self::MATCHES_REGEX => 'MATCHES_REGEX', - self::NOT_MATCHES_REGEX => 'NOT_MATCHES_REGEX', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ContentMatcherOption::class, \Google\Cloud\Monitoring\V3\UptimeCheckConfig_ContentMatcher_ContentMatcherOption::class); - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck.php deleted file mode 100644 index f4575813f5a..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck.php +++ /dev/null @@ -1,538 +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; - /** - * Boolean specifying whether to include SSL certificate validation as a - * part of the Uptime check. Only applies to checks where - * `monitored_resource` is set to `uptime_url`. If `use_ssl` is `false`, - * setting `validate_ssl` to `true` has no effect. - * - * Generated from protobuf field bool validate_ssl = 7; - */ - protected $validate_ssl = false; - /** - * The request body associated with the HTTP POST request. If `content_type` - * is `URL_ENCODED`, the body passed in must be URL-encoded. Users can - * provide a `Content-Length` header via the `headers` field or the API will - * do so. If the `request_method` is `GET` and `body` is not empty, the API - * will return an error. The maximum byte size is 1 megabyte. Note: As with - * all `bytes` fields, JSON representations are base64 encoded. e.g.: - * "foo=bar" in URL-encoded form is "foo%3Dbar" and in base64 encoding is - * "Zm9vJTI1M0RiYXI=". - * - * Generated from protobuf field bytes body = 10; - */ - protected $body = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $request_method - * The HTTP request method to use for the check. If set to - * `METHOD_UNSPECIFIED` then `request_method` defaults to `GET`. - * @type bool $use_ssl - * If `true`, use HTTPS instead of HTTP to run the check. - * @type string $path - * Optional (defaults to "/"). The path to the page against which to run - * the check. Will be combined with the `host` (specified within the - * `monitored_resource`) and `port` to construct the full URL. If the - * provided path does not begin with "/", a "/" will be prepended - * automatically. - * @type int $port - * Optional (defaults to 80 when `use_ssl` is `false`, and 443 when - * `use_ssl` is `true`). The TCP port on the HTTP server against which to - * run the check. Will be combined with host (specified within the - * `monitored_resource`) and `path` to construct the full URL. - * @type \Google\Cloud\Monitoring\V3\UptimeCheckConfig\HttpCheck\BasicAuthentication $auth_info - * The authentication information. Optional when creating an HTTP check; - * defaults to empty. - * @type bool $mask_headers - * Boolean specifying whether to encrypt the header information. - * Encryption should be specified for any headers related to authentication - * that you do not wish to be seen when retrieving the configuration. The - * server will be responsible for encrypting the headers. - * On Get/List calls, if `mask_headers` is set to `true` then the headers - * will be obscured with `******.` - * @type array|\Google\Protobuf\Internal\MapField $headers - * The list of headers to send as part of the Uptime check request. - * If two headers have the same key and different values, they should - * be entered as a single header, with the value being a comma-separated - * list of all the desired values as described at - * https://www.w3.org/Protocols/rfc2616/rfc2616.txt (page 31). - * Entering two separate headers with the same key in a Create call will - * cause the first to be overwritten by the second. - * The maximum number of headers allowed is 100. - * @type int $content_type - * The content type header to use for the check. The following - * configurations result in errors: - * 1. Content type is specified in both the `headers` field and the - * `content_type` field. - * 2. Request method is `GET` and `content_type` is not `TYPE_UNSPECIFIED` - * 3. Request method is `POST` and `content_type` is `TYPE_UNSPECIFIED`. - * 4. Request method is `POST` and a "Content-Type" header is provided via - * `headers` field. The `content_type` field should be used instead. - * @type bool $validate_ssl - * Boolean specifying whether to include SSL certificate validation as a - * part of the Uptime check. Only applies to checks where - * `monitored_resource` is set to `uptime_url`. If `use_ssl` is `false`, - * setting `validate_ssl` to `true` has no effect. - * @type string $body - * The request body associated with the HTTP POST request. If `content_type` - * is `URL_ENCODED`, the body passed in must be URL-encoded. Users can - * provide a `Content-Length` header via the `headers` field or the API will - * do so. If the `request_method` is `GET` and `body` is not empty, the API - * will return an error. The maximum byte size is 1 megabyte. Note: As with - * all `bytes` fields, JSON representations are base64 encoded. e.g.: - * "foo=bar" in URL-encoded form is "foo%3Dbar" and in base64 encoding is - * "Zm9vJTI1M0RiYXI=". - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\Uptime::initOnce(); - parent::__construct($data); - } - - /** - * The HTTP request method to use for the check. If set to - * `METHOD_UNSPECIFIED` then `request_method` defaults to `GET`. - * - * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.HttpCheck.RequestMethod request_method = 8; - * @return int - */ - public function getRequestMethod() - { - return $this->request_method; - } - - /** - * The HTTP request method to use for the check. If set to - * `METHOD_UNSPECIFIED` then `request_method` defaults to `GET`. - * - * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.HttpCheck.RequestMethod request_method = 8; - * @param int $var - * @return $this - */ - public function setRequestMethod($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\UptimeCheckConfig\HttpCheck\RequestMethod::class); - $this->request_method = $var; - - return $this; - } - - /** - * If `true`, use HTTPS instead of HTTP to run the check. - * - * Generated from protobuf field bool use_ssl = 1; - * @return bool - */ - public function getUseSsl() - { - return $this->use_ssl; - } - - /** - * If `true`, use HTTPS instead of HTTP to run the check. - * - * Generated from protobuf field bool use_ssl = 1; - * @param bool $var - * @return $this - */ - public function setUseSsl($var) - { - GPBUtil::checkBool($var); - $this->use_ssl = $var; - - return $this; - } - - /** - * Optional (defaults to "/"). The path to the page against which to run - * the check. Will be combined with the `host` (specified within the - * `monitored_resource`) and `port` to construct the full URL. If the - * provided path does not begin with "/", a "/" will be prepended - * automatically. - * - * Generated from protobuf field string path = 2; - * @return string - */ - public function getPath() - { - return $this->path; - } - - /** - * Optional (defaults to "/"). The path to the page against which to run - * the check. Will be combined with the `host` (specified within the - * `monitored_resource`) and `port` to construct the full URL. If the - * provided path does not begin with "/", a "/" will be prepended - * automatically. - * - * Generated from protobuf field string path = 2; - * @param string $var - * @return $this - */ - public function setPath($var) - { - GPBUtil::checkString($var, True); - $this->path = $var; - - return $this; - } - - /** - * Optional (defaults to 80 when `use_ssl` is `false`, and 443 when - * `use_ssl` is `true`). The TCP port on the HTTP server against which to - * run the check. Will be combined with host (specified within the - * `monitored_resource`) and `path` to construct the full URL. - * - * Generated from protobuf field int32 port = 3; - * @return int - */ - public function getPort() - { - return $this->port; - } - - /** - * Optional (defaults to 80 when `use_ssl` is `false`, and 443 when - * `use_ssl` is `true`). The TCP port on the HTTP server against which to - * run the check. Will be combined with host (specified within the - * `monitored_resource`) and `path` to construct the full URL. - * - * Generated from protobuf field int32 port = 3; - * @param int $var - * @return $this - */ - public function setPort($var) - { - GPBUtil::checkInt32($var); - $this->port = $var; - - return $this; - } - - /** - * The authentication information. Optional when creating an HTTP check; - * defaults to empty. - * - * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.HttpCheck.BasicAuthentication auth_info = 4; - * @return \Google\Cloud\Monitoring\V3\UptimeCheckConfig\HttpCheck\BasicAuthentication|null - */ - public function getAuthInfo() - { - return $this->auth_info; - } - - public function hasAuthInfo() - { - return isset($this->auth_info); - } - - public function clearAuthInfo() - { - unset($this->auth_info); - } - - /** - * The authentication information. Optional when creating an HTTP check; - * defaults to empty. - * - * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.HttpCheck.BasicAuthentication auth_info = 4; - * @param \Google\Cloud\Monitoring\V3\UptimeCheckConfig\HttpCheck\BasicAuthentication $var - * @return $this - */ - public function setAuthInfo($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Monitoring\V3\UptimeCheckConfig\HttpCheck\BasicAuthentication::class); - $this->auth_info = $var; - - return $this; - } - - /** - * Boolean specifying whether to encrypt the header information. - * Encryption should be specified for any headers related to authentication - * that you do not wish to be seen when retrieving the configuration. The - * server will be responsible for encrypting the headers. - * On Get/List calls, if `mask_headers` is set to `true` then the headers - * will be obscured with `******.` - * - * Generated from protobuf field bool mask_headers = 5; - * @return bool - */ - public function getMaskHeaders() - { - return $this->mask_headers; - } - - /** - * Boolean specifying whether to encrypt the header information. - * Encryption should be specified for any headers related to authentication - * that you do not wish to be seen when retrieving the configuration. The - * server will be responsible for encrypting the headers. - * On Get/List calls, if `mask_headers` is set to `true` then the headers - * will be obscured with `******.` - * - * Generated from protobuf field bool mask_headers = 5; - * @param bool $var - * @return $this - */ - public function setMaskHeaders($var) - { - GPBUtil::checkBool($var); - $this->mask_headers = $var; - - return $this; - } - - /** - * The list of headers to send as part of the Uptime check request. - * If two headers have the same key and different values, they should - * be entered as a single header, with the value being a comma-separated - * list of all the desired values as described at - * https://www.w3.org/Protocols/rfc2616/rfc2616.txt (page 31). - * Entering two separate headers with the same key in a Create call will - * cause the first to be overwritten by the second. - * The maximum number of headers allowed is 100. - * - * Generated from protobuf field map headers = 6; - * @return \Google\Protobuf\Internal\MapField - */ - public function getHeaders() - { - return $this->headers; - } - - /** - * The list of headers to send as part of the Uptime check request. - * If two headers have the same key and different values, they should - * be entered as a single header, with the value being a comma-separated - * list of all the desired values as described at - * https://www.w3.org/Protocols/rfc2616/rfc2616.txt (page 31). - * Entering two separate headers with the same key in a Create call will - * cause the first to be overwritten by the second. - * The maximum number of headers allowed is 100. - * - * Generated from protobuf field map headers = 6; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setHeaders($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->headers = $arr; - - return $this; - } - - /** - * The content type header to use for the check. The following - * configurations result in errors: - * 1. Content type is specified in both the `headers` field and the - * `content_type` field. - * 2. Request method is `GET` and `content_type` is not `TYPE_UNSPECIFIED` - * 3. Request method is `POST` and `content_type` is `TYPE_UNSPECIFIED`. - * 4. Request method is `POST` and a "Content-Type" header is provided via - * `headers` field. The `content_type` field should be used instead. - * - * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.HttpCheck.ContentType content_type = 9; - * @return int - */ - public function getContentType() - { - return $this->content_type; - } - - /** - * The content type header to use for the check. The following - * configurations result in errors: - * 1. Content type is specified in both the `headers` field and the - * `content_type` field. - * 2. Request method is `GET` and `content_type` is not `TYPE_UNSPECIFIED` - * 3. Request method is `POST` and `content_type` is `TYPE_UNSPECIFIED`. - * 4. Request method is `POST` and a "Content-Type" header is provided via - * `headers` field. The `content_type` field should be used instead. - * - * Generated from protobuf field .google.monitoring.v3.UptimeCheckConfig.HttpCheck.ContentType content_type = 9; - * @param int $var - * @return $this - */ - public function setContentType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Monitoring\V3\UptimeCheckConfig\HttpCheck\ContentType::class); - $this->content_type = $var; - - return $this; - } - - /** - * Boolean specifying whether to include SSL certificate validation as a - * part of the Uptime check. Only applies to checks where - * `monitored_resource` is set to `uptime_url`. If `use_ssl` is `false`, - * setting `validate_ssl` to `true` has no effect. - * - * Generated from protobuf field bool validate_ssl = 7; - * @return bool - */ - public function getValidateSsl() - { - return $this->validate_ssl; - } - - /** - * Boolean specifying whether to include SSL certificate validation as a - * part of the Uptime check. Only applies to checks where - * `monitored_resource` is set to `uptime_url`. If `use_ssl` is `false`, - * setting `validate_ssl` to `true` has no effect. - * - * Generated from protobuf field bool validate_ssl = 7; - * @param bool $var - * @return $this - */ - public function setValidateSsl($var) - { - GPBUtil::checkBool($var); - $this->validate_ssl = $var; - - return $this; - } - - /** - * The request body associated with the HTTP POST request. If `content_type` - * is `URL_ENCODED`, the body passed in must be URL-encoded. Users can - * provide a `Content-Length` header via the `headers` field or the API will - * do so. If the `request_method` is `GET` and `body` is not empty, the API - * will return an error. The maximum byte size is 1 megabyte. Note: As with - * all `bytes` fields, JSON representations are base64 encoded. e.g.: - * "foo=bar" in URL-encoded form is "foo%3Dbar" and in base64 encoding is - * "Zm9vJTI1M0RiYXI=". - * - * Generated from protobuf field bytes body = 10; - * @return string - */ - public function getBody() - { - return $this->body; - } - - /** - * The request body associated with the HTTP POST request. If `content_type` - * is `URL_ENCODED`, the body passed in must be URL-encoded. Users can - * provide a `Content-Length` header via the `headers` field or the API will - * do so. If the `request_method` is `GET` and `body` is not empty, the API - * will return an error. The maximum byte size is 1 megabyte. Note: As with - * all `bytes` fields, JSON representations are base64 encoded. e.g.: - * "foo=bar" in URL-encoded form is "foo%3Dbar" and in base64 encoding is - * "Zm9vJTI1M0RiYXI=". - * - * Generated from protobuf field bytes body = 10; - * @param string $var - * @return $this - */ - public function setBody($var) - { - GPBUtil::checkString($var, False); - $this->body = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(HttpCheck::class, \Google\Cloud\Monitoring\V3\UptimeCheckConfig_HttpCheck::class); - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck/BasicAuthentication.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/HttpCheck/BasicAuthentication.php 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/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 8acc7779e6b..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig/TcpCheck.php +++ /dev/null @@ -1,78 +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; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $port - * The TCP port on the server against which to run the check. Will be - * combined with host (specified within the `monitored_resource`) to - * construct the full URL. Required. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Monitoring\V3\Uptime::initOnce(); - parent::__construct($data); - } - - /** - * The TCP port on the server against which to run the check. Will be - * combined with host (specified within the `monitored_resource`) to - * construct the full URL. Required. - * - * Generated from protobuf field int32 port = 1; - * @return int - */ - public function getPort() - { - return $this->port; - } - - /** - * The TCP port on the server against which to run the check. Will be - * combined with host (specified within the `monitored_resource`) to - * construct the full URL. Required. - * - * Generated from protobuf field int32 port = 1; - * @param int $var - * @return $this - */ - public function setPort($var) - { - GPBUtil::checkInt32($var); - $this->port = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(TcpCheck::class, \Google\Cloud\Monitoring\V3\UptimeCheckConfig_TcpCheck::class); - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig_ContentMatcher.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig_ContentMatcher.php deleted file mode 100644 index 4ba1f5d9ac4..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckConfig_ContentMatcher.php +++ /dev/null @@ -1,16 +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 e0ba1c64364..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckRegion.php +++ /dev/null @@ -1,78 +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; - - private static $valueToName = [ - self::REGION_UNSPECIFIED => 'REGION_UNSPECIFIED', - self::USA => 'USA', - self::EUROPE => 'EUROPE', - self::SOUTH_AMERICA => 'SOUTH_AMERICA', - self::ASIA_PACIFIC => 'ASIA_PACIFIC', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckServiceGrpcClient.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckServiceGrpcClient.php deleted file mode 100644 index 602a63f3bcd..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/UptimeCheckServiceGrpcClient.php +++ /dev/null @@ -1,138 +0,0 @@ -_simpleRequest('/google.monitoring.v3.UptimeCheckService/ListUptimeCheckConfigs', - $argument, - ['\Google\Cloud\Monitoring\V3\ListUptimeCheckConfigsResponse', 'decode'], - $metadata, $options); - } - - /** - * Gets a single Uptime check configuration. - * @param \Google\Cloud\Monitoring\V3\GetUptimeCheckConfigRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetUptimeCheckConfig(\Google\Cloud\Monitoring\V3\GetUptimeCheckConfigRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.monitoring.v3.UptimeCheckService/GetUptimeCheckConfig', - $argument, - ['\Google\Cloud\Monitoring\V3\UptimeCheckConfig', 'decode'], - $metadata, $options); - } - - /** - * Creates a new Uptime check configuration. - * @param \Google\Cloud\Monitoring\V3\CreateUptimeCheckConfigRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateUptimeCheckConfig(\Google\Cloud\Monitoring\V3\CreateUptimeCheckConfigRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.monitoring.v3.UptimeCheckService/CreateUptimeCheckConfig', - $argument, - ['\Google\Cloud\Monitoring\V3\UptimeCheckConfig', 'decode'], - $metadata, $options); - } - - /** - * Updates an Uptime check configuration. You can either replace the entire - * configuration with a new one or replace only certain fields in the current - * configuration by specifying the fields to be updated via `updateMask`. - * Returns the updated configuration. - * @param \Google\Cloud\Monitoring\V3\UpdateUptimeCheckConfigRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateUptimeCheckConfig(\Google\Cloud\Monitoring\V3\UpdateUptimeCheckConfigRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.monitoring.v3.UptimeCheckService/UpdateUptimeCheckConfig', - $argument, - ['\Google\Cloud\Monitoring\V3\UptimeCheckConfig', 'decode'], - $metadata, $options); - } - - /** - * Deletes an Uptime check configuration. Note that this method will fail - * if the Uptime check configuration is referenced by an alert policy or - * other dependent configs that would be rendered invalid by the deletion. - * @param \Google\Cloud\Monitoring\V3\DeleteUptimeCheckConfigRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteUptimeCheckConfig(\Google\Cloud\Monitoring\V3\DeleteUptimeCheckConfigRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.monitoring.v3.UptimeCheckService/DeleteUptimeCheckConfig', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - - /** - * Returns the list of IP addresses that checkers run from - * @param \Google\Cloud\Monitoring\V3\ListUptimeCheckIpsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListUptimeCheckIps(\Google\Cloud\Monitoring\V3\ListUptimeCheckIpsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.monitoring.v3.UptimeCheckService/ListUptimeCheckIps', - $argument, - ['\Google\Cloud\Monitoring\V3\ListUptimeCheckIpsResponse', 'decode'], - $metadata, $options); - } - -} diff --git a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/VerifyNotificationChannelRequest.php b/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/VerifyNotificationChannelRequest.php deleted file mode 100644 index 926f5089a26..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/VerifyNotificationChannelRequest.php +++ /dev/null @@ -1,125 +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 = ''; - - /** - * 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/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 e35bfef8d80..00000000000 --- a/owl-bot-staging/Monitoring/v3/proto/src/Google/Cloud/Monitoring/V3/WindowsBasedSli_MetricRange.php +++ /dev/null @@ -1,16 +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. - */ -class AlertPolicyServiceGapicClient -{ - use GapicClientTrait; - - /** - * The name of the service. - */ - const SERVICE_NAME = 'google.monitoring.v3.AlertPolicyService'; - - /** - * The default address of the service. - */ - const SERVICE_ADDRESS = 'monitoring.googleapis.com'; - - /** - * The default port of the service. - */ - const DEFAULT_SERVICE_PORT = 443; - - /** - * The name of the code generator, to be included in the agent header. - */ - const CODEGEN_NAME = 'gapic'; - - /** - * The default scopes required by the service. - */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/monitoring', - 'https://www.googleapis.com/auth/monitoring.read', - ]; - - private static $alertPolicyNameTemplate; - - private static $folderAlertPolicyNameTemplate; - - private static $organizationAlertPolicyNameTemplate; - - private static $projectAlertPolicyNameTemplate; - - private static $pathTemplateMap; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'serviceAddress' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/alert_policy_service_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/alert_policy_service_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/alert_policy_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/alert_policy_service_rest_client_config.php', - ], - ], - ]; - } - - private static function getAlertPolicyNameTemplate() - { - if (self::$alertPolicyNameTemplate == null) { - self::$alertPolicyNameTemplate = new PathTemplate('projects/{project}/alertPolicies/{alert_policy}'); - } - - return self::$alertPolicyNameTemplate; - } - - private static function getFolderAlertPolicyNameTemplate() - { - if (self::$folderAlertPolicyNameTemplate == null) { - self::$folderAlertPolicyNameTemplate = new PathTemplate('folders/{folder}/alertPolicies/{alert_policy}'); - } - - return self::$folderAlertPolicyNameTemplate; - } - - private static function getOrganizationAlertPolicyNameTemplate() - { - if (self::$organizationAlertPolicyNameTemplate == null) { - self::$organizationAlertPolicyNameTemplate = new PathTemplate('organizations/{organization}/alertPolicies/{alert_policy}'); - } - - return self::$organizationAlertPolicyNameTemplate; - } - - private static function getProjectAlertPolicyNameTemplate() - { - if (self::$projectAlertPolicyNameTemplate == null) { - self::$projectAlertPolicyNameTemplate = new PathTemplate('projects/{project}/alertPolicies/{alert_policy}'); - } - - return self::$projectAlertPolicyNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'alertPolicy' => self::getAlertPolicyNameTemplate(), - 'folderAlertPolicy' => self::getFolderAlertPolicyNameTemplate(), - 'organizationAlertPolicy' => self::getOrganizationAlertPolicyNameTemplate(), - 'projectAlertPolicy' => self::getProjectAlertPolicyNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a alert_policy - * resource. - * - * @param string $project - * @param string $alertPolicy - * - * @return string The formatted alert_policy resource. - */ - public static function alertPolicyName($project, $alertPolicy) - { - return self::getAlertPolicyNameTemplate()->render([ - 'project' => $project, - 'alert_policy' => $alertPolicy, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * folder_alert_policy resource. - * - * @param string $folder - * @param string $alertPolicy - * - * @return string The formatted folder_alert_policy resource. - */ - public static function folderAlertPolicyName($folder, $alertPolicy) - { - return self::getFolderAlertPolicyNameTemplate()->render([ - 'folder' => $folder, - 'alert_policy' => $alertPolicy, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * organization_alert_policy resource. - * - * @param string $organization - * @param string $alertPolicy - * - * @return string The formatted organization_alert_policy resource. - */ - public static function organizationAlertPolicyName($organization, $alertPolicy) - { - return self::getOrganizationAlertPolicyNameTemplate()->render([ - 'organization' => $organization, - 'alert_policy' => $alertPolicy, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_alert_policy resource. - * - * @param string $project - * @param string $alertPolicy - * - * @return string The formatted project_alert_policy resource. - */ - public static function projectAlertPolicyName($project, $alertPolicy) - { - return self::getProjectAlertPolicyNameTemplate()->render([ - 'project' => $project, - 'alert_policy' => $alertPolicy, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - alertPolicy: projects/{project}/alertPolicies/{alert_policy} - * - folderAlertPolicy: folders/{folder}/alertPolicies/{alert_policy} - * - organizationAlertPolicy: organizations/{organization}/alertPolicies/{alert_policy} - * - projectAlertPolicy: projects/{project}/alertPolicies/{alert_policy} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $serviceAddress - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'monitoring.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $serviceAddress setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * Creates a new alerting policy. - * - * Sample code: - * ``` - * $alertPolicyServiceClient = new AlertPolicyServiceClient(); - * try { - * $name = 'name'; - * $alertPolicy = new AlertPolicy(); - * $response = $alertPolicyServiceClient->createAlertPolicy($name, $alertPolicy); - * } finally { - * $alertPolicyServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) in - * which to create the alerting policy. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER] - * - * Note that this field names the parent container in which the alerting - * policy will be written, not the name of the created policy. |name| must be - * a host project of a workspace, otherwise INVALID_ARGUMENT error will - * return. The alerting policy that is returned will have a name that contains - * a normalized representation of this name as a prefix but adds a suffix of - * the form `/alertPolicies/[ALERT_POLICY_ID]`, identifying the policy in the - * container. - * @param AlertPolicy $alertPolicy Required. The requested alerting policy. You should omit the `name` field in this - * policy. The name will be returned in the new policy, including - * a new `[ALERT_POLICY_ID]` value. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Monitoring\V3\AlertPolicy - * - * @throws ApiException if the remote call fails - */ - public function createAlertPolicy($name, $alertPolicy, array $optionalArgs = []) - { - $request = new CreateAlertPolicyRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setAlertPolicy($alertPolicy); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateAlertPolicy', AlertPolicy::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes an alerting policy. - * - * Sample code: - * ``` - * $alertPolicyServiceClient = new AlertPolicyServiceClient(); - * try { - * $formattedName = $alertPolicyServiceClient->alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); - * $alertPolicyServiceClient->deleteAlertPolicy($formattedName); - * } finally { - * $alertPolicyServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The alerting policy to delete. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] - * - * For more information, see [AlertPolicy][google.monitoring.v3.AlertPolicy]. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - */ - public function deleteAlertPolicy($name, array $optionalArgs = []) - { - $request = new DeleteAlertPolicyRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteAlertPolicy', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets a single alerting policy. - * - * Sample code: - * ``` - * $alertPolicyServiceClient = new AlertPolicyServiceClient(); - * try { - * $formattedName = $alertPolicyServiceClient->alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); - * $response = $alertPolicyServiceClient->getAlertPolicy($formattedName); - * } finally { - * $alertPolicyServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The alerting policy to retrieve. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Monitoring\V3\AlertPolicy - * - * @throws ApiException if the remote call fails - */ - public function getAlertPolicy($name, array $optionalArgs = []) - { - $request = new GetAlertPolicyRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetAlertPolicy', AlertPolicy::class, $optionalArgs, $request)->wait(); - } - - /** - * Lists the existing alerting policies for the workspace. - * - * Sample code: - * ``` - * $alertPolicyServiceClient = new AlertPolicyServiceClient(); - * try { - * $name = 'name'; - * // Iterate over pages of elements - * $pagedResponse = $alertPolicyServiceClient->listAlertPolicies($name); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $alertPolicyServiceClient->listAlertPolicies($name); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $alertPolicyServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) - * whose alert policies are to be listed. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER] - * - * Note that this field names the parent container in which the alerting - * policies to be listed are stored. To retrieve a single alerting policy - * by name, use the - * [GetAlertPolicy][google.monitoring.v3.AlertPolicyService.GetAlertPolicy] - * operation, instead. - * @param array $optionalArgs { - * Optional. - * - * @type string $filter - * If provided, this field specifies the criteria that must be met by - * alert policies to be included in the response. - * - * For more details, see [sorting and - * filtering](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering). - * @type string $orderBy - * A comma-separated list of fields by which to sort the result. Supports - * the same set of field references as the `filter` field. Entries can be - * prefixed with a minus sign to sort by the field in descending order. - * - * For more details, see [sorting and - * filtering](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering). - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listAlertPolicies($name, array $optionalArgs = []) - { - $request = new ListAlertPoliciesRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListAlertPolicies', $optionalArgs, ListAlertPoliciesResponse::class, $request); - } - - /** - * Updates an alerting policy. You can either replace the entire policy with - * a new one or replace only certain fields in the current alerting policy by - * specifying the fields to be updated via `updateMask`. Returns the - * updated alerting policy. - * - * Sample code: - * ``` - * $alertPolicyServiceClient = new AlertPolicyServiceClient(); - * try { - * $alertPolicy = new AlertPolicy(); - * $response = $alertPolicyServiceClient->updateAlertPolicy($alertPolicy); - * } finally { - * $alertPolicyServiceClient->close(); - * } - * ``` - * - * @param AlertPolicy $alertPolicy Required. The updated alerting policy or the updated values for the - * fields listed in `update_mask`. - * If `update_mask` is not empty, any fields in this policy that are - * not in `update_mask` are ignored. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * Optional. A list of alerting policy field names. If this field is not - * empty, each listed field in the existing alerting policy is set to the - * value of the corresponding field in the supplied policy (`alert_policy`), - * or to the field's default value if the field is not in the supplied - * alerting policy. Fields not listed retain their previous value. - * - * Examples of valid field masks include `display_name`, `documentation`, - * `documentation.content`, `documentation.mime_type`, `user_labels`, - * `user_label.nameofkey`, `enabled`, `conditions`, `combiner`, etc. - * - * If this field is empty, then the supplied alerting policy replaces the - * existing policy. It is the same as deleting the existing policy and - * adding the supplied policy, except for the following: - * - * + The new policy will have the same `[ALERT_POLICY_ID]` as the former - * policy. This gives you continuity with the former policy in your - * notifications and incidents. - * + Conditions in the new policy will keep their former `[CONDITION_ID]` if - * the supplied condition includes the `name` field with that - * `[CONDITION_ID]`. If the supplied condition omits the `name` field, - * then a new `[CONDITION_ID]` is created. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Monitoring\V3\AlertPolicy - * - * @throws ApiException if the remote call fails - */ - public function updateAlertPolicy($alertPolicy, array $optionalArgs = []) - { - $request = new UpdateAlertPolicyRequest(); - $requestParamHeaders = []; - $request->setAlertPolicy($alertPolicy); - $requestParamHeaders['alert_policy.name'] = $alertPolicy->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateAlertPolicy', AlertPolicy::class, $optionalArgs, $request)->wait(); - } -} diff --git a/owl-bot-staging/Monitoring/v3/src/V3/Gapic/GroupServiceGapicClient.php b/owl-bot-staging/Monitoring/v3/src/V3/Gapic/GroupServiceGapicClient.php deleted file mode 100644 index c8615f7dbee..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/Gapic/GroupServiceGapicClient.php +++ /dev/null @@ -1,757 +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. - */ -class GroupServiceGapicClient -{ - use GapicClientTrait; - - /** - * The name of the service. - */ - const SERVICE_NAME = 'google.monitoring.v3.GroupService'; - - /** - * The default address of the service. - */ - const SERVICE_ADDRESS = 'monitoring.googleapis.com'; - - /** - * The default port of the service. - */ - const DEFAULT_SERVICE_PORT = 443; - - /** - * The name of the code generator, to be included in the agent header. - */ - const CODEGEN_NAME = 'gapic'; - - /** - * The default scopes required by the service. - */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/monitoring', - 'https://www.googleapis.com/auth/monitoring.read', - ]; - - private static $folderGroupNameTemplate; - - private static $groupNameTemplate; - - private static $organizationGroupNameTemplate; - - private static $projectGroupNameTemplate; - - private static $pathTemplateMap; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'serviceAddress' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/group_service_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/group_service_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/group_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/group_service_rest_client_config.php', - ], - ], - ]; - } - - private static function getFolderGroupNameTemplate() - { - if (self::$folderGroupNameTemplate == null) { - self::$folderGroupNameTemplate = new PathTemplate('folders/{folder}/groups/{group}'); - } - - return self::$folderGroupNameTemplate; - } - - private static function getGroupNameTemplate() - { - if (self::$groupNameTemplate == null) { - self::$groupNameTemplate = new PathTemplate('projects/{project}/groups/{group}'); - } - - return self::$groupNameTemplate; - } - - private static function getOrganizationGroupNameTemplate() - { - if (self::$organizationGroupNameTemplate == null) { - self::$organizationGroupNameTemplate = new PathTemplate('organizations/{organization}/groups/{group}'); - } - - return self::$organizationGroupNameTemplate; - } - - private static function getProjectGroupNameTemplate() - { - if (self::$projectGroupNameTemplate == null) { - self::$projectGroupNameTemplate = new PathTemplate('projects/{project}/groups/{group}'); - } - - return self::$projectGroupNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'folderGroup' => self::getFolderGroupNameTemplate(), - 'group' => self::getGroupNameTemplate(), - 'organizationGroup' => self::getOrganizationGroupNameTemplate(), - 'projectGroup' => self::getProjectGroupNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a folder_group - * resource. - * - * @param string $folder - * @param string $group - * - * @return string The formatted folder_group resource. - */ - public static function folderGroupName($folder, $group) - { - return self::getFolderGroupNameTemplate()->render([ - 'folder' => $folder, - 'group' => $group, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a group - * resource. - * - * @param string $project - * @param string $group - * - * @return string The formatted group resource. - */ - public static function groupName($project, $group) - { - return self::getGroupNameTemplate()->render([ - 'project' => $project, - 'group' => $group, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * organization_group resource. - * - * @param string $organization - * @param string $group - * - * @return string The formatted organization_group resource. - */ - public static function organizationGroupName($organization, $group) - { - return self::getOrganizationGroupNameTemplate()->render([ - 'organization' => $organization, - 'group' => $group, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_group resource. - * - * @param string $project - * @param string $group - * - * @return string The formatted project_group resource. - */ - public static function projectGroupName($project, $group) - { - return self::getProjectGroupNameTemplate()->render([ - 'project' => $project, - 'group' => $group, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - folderGroup: folders/{folder}/groups/{group} - * - group: projects/{project}/groups/{group} - * - organizationGroup: organizations/{organization}/groups/{group} - * - projectGroup: projects/{project}/groups/{group} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $serviceAddress - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'monitoring.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $serviceAddress setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * Creates a new group. - * - * Sample code: - * ``` - * $groupServiceClient = new GroupServiceClient(); - * try { - * $name = 'name'; - * $group = new Group(); - * $response = $groupServiceClient->createGroup($name, $group); - * } finally { - * $groupServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) in - * which to create the group. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER] - * @param Group $group Required. A group definition. It is an error to define the `name` field because - * the system assigns the name. - * @param array $optionalArgs { - * Optional. - * - * @type bool $validateOnly - * If true, validate this request but do not create the group. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Monitoring\V3\Group - * - * @throws ApiException if the remote call fails - */ - public function createGroup($name, $group, array $optionalArgs = []) - { - $request = new CreateGroupRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setGroup($group); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateGroup', Group::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes an existing group. - * - * Sample code: - * ``` - * $groupServiceClient = new GroupServiceClient(); - * try { - * $formattedName = $groupServiceClient->groupName('[PROJECT]', '[GROUP]'); - * $groupServiceClient->deleteGroup($formattedName); - * } finally { - * $groupServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The group to delete. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] - * @param array $optionalArgs { - * Optional. - * - * @type bool $recursive - * If this field is true, then the request means to delete a group with all - * its descendants. Otherwise, the request means to delete a group only when - * it has no descendants. The default value is false. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - */ - public function deleteGroup($name, array $optionalArgs = []) - { - $request = new DeleteGroupRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['recursive'])) { - $request->setRecursive($optionalArgs['recursive']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteGroup', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets a single group. - * - * Sample code: - * ``` - * $groupServiceClient = new GroupServiceClient(); - * try { - * $formattedName = $groupServiceClient->groupName('[PROJECT]', '[GROUP]'); - * $response = $groupServiceClient->getGroup($formattedName); - * } finally { - * $groupServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The group to retrieve. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Monitoring\V3\Group - * - * @throws ApiException if the remote call fails - */ - public function getGroup($name, array $optionalArgs = []) - { - $request = new GetGroupRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetGroup', Group::class, $optionalArgs, $request)->wait(); - } - - /** - * Lists the monitored resources that are members of a group. - * - * Sample code: - * ``` - * $groupServiceClient = new GroupServiceClient(); - * try { - * $formattedName = $groupServiceClient->groupName('[PROJECT]', '[GROUP]'); - * // Iterate over pages of elements - * $pagedResponse = $groupServiceClient->listGroupMembers($formattedName); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $groupServiceClient->listGroupMembers($formattedName); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $groupServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The group whose members are listed. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * An optional [list - * filter](https://cloud.google.com/monitoring/api/learn_more#filtering) - * describing the members to be returned. The filter may reference the type, - * labels, and metadata of monitored resources that comprise the group. For - * example, to return only resources representing Compute Engine VM instances, - * use this filter: - * - * `resource.type = "gce_instance"` - * @type TimeInterval $interval - * An optional time interval for which results should be returned. Only - * members that were part of the group during the specified interval are - * included in the response. If no interval is provided then the group - * membership over the last minute is returned. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listGroupMembers($name, array $optionalArgs = []) - { - $request = new ListGroupMembersRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['interval'])) { - $request->setInterval($optionalArgs['interval']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListGroupMembers', $optionalArgs, ListGroupMembersResponse::class, $request); - } - - /** - * Lists the existing groups. - * - * Sample code: - * ``` - * $groupServiceClient = new GroupServiceClient(); - * try { - * $name = 'name'; - * // Iterate over pages of elements - * $pagedResponse = $groupServiceClient->listGroups($name); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $groupServiceClient->listGroups($name); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $groupServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) - * whose groups are to be listed. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER] - * @param array $optionalArgs { - * Optional. - * - * @type string $childrenOfGroup - * A group name. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] - * - * Returns groups whose `parent_name` field contains the group - * name. If no groups have this parent, the results are empty. - * @type string $ancestorsOfGroup - * A group name. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] - * - * Returns groups that are ancestors of the specified group. - * The groups are returned in order, starting with the immediate parent and - * ending with the most distant ancestor. If the specified group has no - * immediate parent, the results are empty. - * @type string $descendantsOfGroup - * A group name. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] - * - * Returns the descendants of the specified group. This is a superset of - * the results returned by the `children_of_group` filter, and includes - * children-of-children, and so forth. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listGroups($name, array $optionalArgs = []) - { - $request = new ListGroupsRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['childrenOfGroup'])) { - $request->setChildrenOfGroup($optionalArgs['childrenOfGroup']); - } - - if (isset($optionalArgs['ancestorsOfGroup'])) { - $request->setAncestorsOfGroup($optionalArgs['ancestorsOfGroup']); - } - - if (isset($optionalArgs['descendantsOfGroup'])) { - $request->setDescendantsOfGroup($optionalArgs['descendantsOfGroup']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListGroups', $optionalArgs, ListGroupsResponse::class, $request); - } - - /** - * Updates an existing group. - * You can change any group attributes except `name`. - * - * Sample code: - * ``` - * $groupServiceClient = new GroupServiceClient(); - * try { - * $group = new Group(); - * $response = $groupServiceClient->updateGroup($group); - * } finally { - * $groupServiceClient->close(); - * } - * ``` - * - * @param Group $group Required. The new definition of the group. All fields of the existing group, - * excepting `name`, are replaced with the corresponding fields of this group. - * @param array $optionalArgs { - * Optional. - * - * @type bool $validateOnly - * If true, validate this request but do not update the existing group. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Monitoring\V3\Group - * - * @throws ApiException if the remote call fails - */ - public function updateGroup($group, array $optionalArgs = []) - { - $request = new UpdateGroupRequest(); - $requestParamHeaders = []; - $request->setGroup($group); - $requestParamHeaders['group.name'] = $group->getName(); - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateGroup', Group::class, $optionalArgs, $request)->wait(); - } -} diff --git a/owl-bot-staging/Monitoring/v3/src/V3/Gapic/MetricServiceGapicClient.php b/owl-bot-staging/Monitoring/v3/src/V3/Gapic/MetricServiceGapicClient.php deleted file mode 100644 index ff05de43799..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/Gapic/MetricServiceGapicClient.php +++ /dev/null @@ -1,1176 +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. - */ -class MetricServiceGapicClient -{ - use GapicClientTrait; - - /** - * The name of the service. - */ - const SERVICE_NAME = 'google.monitoring.v3.MetricService'; - - /** - * The default address of the service. - */ - const SERVICE_ADDRESS = 'monitoring.googleapis.com'; - - /** - * The default port of the service. - */ - const DEFAULT_SERVICE_PORT = 443; - - /** - * The name of the code generator, to be included in the agent header. - */ - const CODEGEN_NAME = 'gapic'; - - /** - * The default scopes required by the service. - */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/monitoring', - 'https://www.googleapis.com/auth/monitoring.read', - 'https://www.googleapis.com/auth/monitoring.write', - ]; - - private static $folderNameTemplate; - - private static $folderMetricDescriptorNameTemplate; - - private static $folderMonitoredResourceDescriptorNameTemplate; - - private static $metricDescriptorNameTemplate; - - private static $monitoredResourceDescriptorNameTemplate; - - private static $organizationNameTemplate; - - private static $organizationMetricDescriptorNameTemplate; - - private static $organizationMonitoredResourceDescriptorNameTemplate; - - private static $projectNameTemplate; - - private static $projectMetricDescriptorNameTemplate; - - private static $projectMonitoredResourceDescriptorNameTemplate; - - private static $workspaceNameTemplate; - - private static $pathTemplateMap; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'serviceAddress' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/metric_service_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/metric_service_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/metric_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/metric_service_rest_client_config.php', - ], - ], - ]; - } - - private static function getFolderNameTemplate() - { - if (self::$folderNameTemplate == null) { - self::$folderNameTemplate = new PathTemplate('folders/{folder}'); - } - - return self::$folderNameTemplate; - } - - private static function getFolderMetricDescriptorNameTemplate() - { - if (self::$folderMetricDescriptorNameTemplate == null) { - self::$folderMetricDescriptorNameTemplate = new PathTemplate('folders/{folder}/metricDescriptors/{metric_descriptor=**}'); - } - - return self::$folderMetricDescriptorNameTemplate; - } - - private static function getFolderMonitoredResourceDescriptorNameTemplate() - { - if (self::$folderMonitoredResourceDescriptorNameTemplate == null) { - self::$folderMonitoredResourceDescriptorNameTemplate = new PathTemplate('folders/{folder}/monitoredResourceDescriptors/{monitored_resource_descriptor}'); - } - - return self::$folderMonitoredResourceDescriptorNameTemplate; - } - - private static function getMetricDescriptorNameTemplate() - { - if (self::$metricDescriptorNameTemplate == null) { - self::$metricDescriptorNameTemplate = new PathTemplate('projects/{project}/metricDescriptors/{metric_descriptor=**}'); - } - - return self::$metricDescriptorNameTemplate; - } - - private static function getMonitoredResourceDescriptorNameTemplate() - { - if (self::$monitoredResourceDescriptorNameTemplate == null) { - self::$monitoredResourceDescriptorNameTemplate = new PathTemplate('projects/{project}/monitoredResourceDescriptors/{monitored_resource_descriptor}'); - } - - return self::$monitoredResourceDescriptorNameTemplate; - } - - private static function getOrganizationNameTemplate() - { - if (self::$organizationNameTemplate == null) { - self::$organizationNameTemplate = new PathTemplate('organizations/{organization}'); - } - - return self::$organizationNameTemplate; - } - - private static function getOrganizationMetricDescriptorNameTemplate() - { - if (self::$organizationMetricDescriptorNameTemplate == null) { - self::$organizationMetricDescriptorNameTemplate = new PathTemplate('organizations/{organization}/metricDescriptors/{metric_descriptor=**}'); - } - - return self::$organizationMetricDescriptorNameTemplate; - } - - private static function getOrganizationMonitoredResourceDescriptorNameTemplate() - { - if (self::$organizationMonitoredResourceDescriptorNameTemplate == null) { - self::$organizationMonitoredResourceDescriptorNameTemplate = new PathTemplate('organizations/{organization}/monitoredResourceDescriptors/{monitored_resource_descriptor}'); - } - - return self::$organizationMonitoredResourceDescriptorNameTemplate; - } - - private static function getProjectNameTemplate() - { - if (self::$projectNameTemplate == null) { - self::$projectNameTemplate = new PathTemplate('projects/{project}'); - } - - return self::$projectNameTemplate; - } - - private static function getProjectMetricDescriptorNameTemplate() - { - if (self::$projectMetricDescriptorNameTemplate == null) { - self::$projectMetricDescriptorNameTemplate = new PathTemplate('projects/{project}/metricDescriptors/{metric_descriptor=**}'); - } - - return self::$projectMetricDescriptorNameTemplate; - } - - private static function getProjectMonitoredResourceDescriptorNameTemplate() - { - if (self::$projectMonitoredResourceDescriptorNameTemplate == null) { - self::$projectMonitoredResourceDescriptorNameTemplate = new PathTemplate('projects/{project}/monitoredResourceDescriptors/{monitored_resource_descriptor}'); - } - - return self::$projectMonitoredResourceDescriptorNameTemplate; - } - - private static function getWorkspaceNameTemplate() - { - if (self::$workspaceNameTemplate == null) { - self::$workspaceNameTemplate = new PathTemplate('projects/{project}'); - } - - return self::$workspaceNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'folder' => self::getFolderNameTemplate(), - 'folderMetricDescriptor' => self::getFolderMetricDescriptorNameTemplate(), - 'folderMonitoredResourceDescriptor' => self::getFolderMonitoredResourceDescriptorNameTemplate(), - 'metricDescriptor' => self::getMetricDescriptorNameTemplate(), - 'monitoredResourceDescriptor' => self::getMonitoredResourceDescriptorNameTemplate(), - 'organization' => self::getOrganizationNameTemplate(), - 'organizationMetricDescriptor' => self::getOrganizationMetricDescriptorNameTemplate(), - 'organizationMonitoredResourceDescriptor' => self::getOrganizationMonitoredResourceDescriptorNameTemplate(), - 'project' => self::getProjectNameTemplate(), - 'projectMetricDescriptor' => self::getProjectMetricDescriptorNameTemplate(), - 'projectMonitoredResourceDescriptor' => self::getProjectMonitoredResourceDescriptorNameTemplate(), - 'workspace' => self::getWorkspaceNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a folder - * resource. - * - * @param string $folder - * - * @return string The formatted folder resource. - */ - public static function folderName($folder) - { - return self::getFolderNameTemplate()->render([ - 'folder' => $folder, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * folder_metric_descriptor resource. - * - * @param string $folder - * @param string $metricDescriptor - * - * @return string The formatted folder_metric_descriptor resource. - */ - public static function folderMetricDescriptorName($folder, $metricDescriptor) - { - return self::getFolderMetricDescriptorNameTemplate()->render([ - 'folder' => $folder, - 'metric_descriptor' => $metricDescriptor, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * folder_monitored_resource_descriptor resource. - * - * @param string $folder - * @param string $monitoredResourceDescriptor - * - * @return string The formatted folder_monitored_resource_descriptor resource. - */ - public static function folderMonitoredResourceDescriptorName($folder, $monitoredResourceDescriptor) - { - return self::getFolderMonitoredResourceDescriptorNameTemplate()->render([ - 'folder' => $folder, - 'monitored_resource_descriptor' => $monitoredResourceDescriptor, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * metric_descriptor resource. - * - * @param string $project - * @param string $metricDescriptor - * - * @return string The formatted metric_descriptor resource. - */ - public static function metricDescriptorName($project, $metricDescriptor) - { - return self::getMetricDescriptorNameTemplate()->render([ - 'project' => $project, - 'metric_descriptor' => $metricDescriptor, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * monitored_resource_descriptor resource. - * - * @param string $project - * @param string $monitoredResourceDescriptor - * - * @return string The formatted monitored_resource_descriptor resource. - */ - public static function monitoredResourceDescriptorName($project, $monitoredResourceDescriptor) - { - return self::getMonitoredResourceDescriptorNameTemplate()->render([ - 'project' => $project, - 'monitored_resource_descriptor' => $monitoredResourceDescriptor, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a organization - * resource. - * - * @param string $organization - * - * @return string The formatted organization resource. - */ - public static function organizationName($organization) - { - return self::getOrganizationNameTemplate()->render([ - 'organization' => $organization, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * organization_metric_descriptor resource. - * - * @param string $organization - * @param string $metricDescriptor - * - * @return string The formatted organization_metric_descriptor resource. - */ - public static function organizationMetricDescriptorName($organization, $metricDescriptor) - { - return self::getOrganizationMetricDescriptorNameTemplate()->render([ - 'organization' => $organization, - 'metric_descriptor' => $metricDescriptor, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * organization_monitored_resource_descriptor resource. - * - * @param string $organization - * @param string $monitoredResourceDescriptor - * - * @return string The formatted organization_monitored_resource_descriptor resource. - */ - public static function organizationMonitoredResourceDescriptorName($organization, $monitoredResourceDescriptor) - { - return self::getOrganizationMonitoredResourceDescriptorNameTemplate()->render([ - 'organization' => $organization, - 'monitored_resource_descriptor' => $monitoredResourceDescriptor, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a project - * resource. - * - * @param string $project - * - * @return string The formatted project resource. - */ - public static function projectName($project) - { - return self::getProjectNameTemplate()->render([ - 'project' => $project, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_metric_descriptor resource. - * - * @param string $project - * @param string $metricDescriptor - * - * @return string The formatted project_metric_descriptor resource. - */ - public static function projectMetricDescriptorName($project, $metricDescriptor) - { - return self::getProjectMetricDescriptorNameTemplate()->render([ - 'project' => $project, - 'metric_descriptor' => $metricDescriptor, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_monitored_resource_descriptor resource. - * - * @param string $project - * @param string $monitoredResourceDescriptor - * - * @return string The formatted project_monitored_resource_descriptor resource. - */ - public static function projectMonitoredResourceDescriptorName($project, $monitoredResourceDescriptor) - { - return self::getProjectMonitoredResourceDescriptorNameTemplate()->render([ - 'project' => $project, - 'monitored_resource_descriptor' => $monitoredResourceDescriptor, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a workspace - * resource. - * - * @param string $project - * - * @return string The formatted workspace resource. - */ - public static function workspaceName($project) - { - return self::getWorkspaceNameTemplate()->render([ - 'project' => $project, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - folder: folders/{folder} - * - folderMetricDescriptor: folders/{folder}/metricDescriptors/{metric_descriptor=**} - * - folderMonitoredResourceDescriptor: folders/{folder}/monitoredResourceDescriptors/{monitored_resource_descriptor} - * - metricDescriptor: projects/{project}/metricDescriptors/{metric_descriptor=**} - * - monitoredResourceDescriptor: projects/{project}/monitoredResourceDescriptors/{monitored_resource_descriptor} - * - organization: organizations/{organization} - * - organizationMetricDescriptor: organizations/{organization}/metricDescriptors/{metric_descriptor=**} - * - organizationMonitoredResourceDescriptor: organizations/{organization}/monitoredResourceDescriptors/{monitored_resource_descriptor} - * - project: projects/{project} - * - projectMetricDescriptor: projects/{project}/metricDescriptors/{metric_descriptor=**} - * - projectMonitoredResourceDescriptor: projects/{project}/monitoredResourceDescriptors/{monitored_resource_descriptor} - * - workspace: projects/{project} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $serviceAddress - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'monitoring.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $serviceAddress setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * Creates a new metric descriptor. - * The creation is executed asynchronously and callers may check the returned - * operation to track its progress. - * User-created metric descriptors define - * [custom metrics](https://cloud.google.com/monitoring/custom-metrics). - * - * Sample code: - * ``` - * $metricServiceClient = new MetricServiceClient(); - * try { - * $name = 'name'; - * $metricDescriptor = new MetricDescriptor(); - * $response = $metricServiceClient->createMetricDescriptor($name, $metricDescriptor); - * } finally { - * $metricServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on - * which to execute the request. The format is: - * 4 - * projects/[PROJECT_ID_OR_NUMBER] - * @param MetricDescriptor $metricDescriptor Required. The new [custom metric](https://cloud.google.com/monitoring/custom-metrics) - * descriptor. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\Api\MetricDescriptor - * - * @throws ApiException if the remote call fails - */ - public function createMetricDescriptor($name, $metricDescriptor, array $optionalArgs = []) - { - $request = new CreateMetricDescriptorRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setMetricDescriptor($metricDescriptor); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateMetricDescriptor', MetricDescriptor::class, $optionalArgs, $request)->wait(); - } - - /** - * Creates or adds data to one or more service time series. A service time - * series is a time series for a metric from a Google Cloud service. The - * response is empty if all time series in the request were written. If any - * time series could not be written, a corresponding failure message is - * included in the error response. This endpoint rejects writes to - * user-defined metrics. - * This method is only for use by Google Cloud services. Use - * [projects.timeSeries.create][google.monitoring.v3.MetricService.CreateTimeSeries] - * instead. - * - * Sample code: - * ``` - * $metricServiceClient = new MetricServiceClient(); - * try { - * $formattedName = $metricServiceClient->projectName('[PROJECT]'); - * $timeSeries = []; - * $metricServiceClient->createServiceTimeSeries($formattedName, $timeSeries); - * } finally { - * $metricServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on - * which to execute the request. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER] - * @param TimeSeries[] $timeSeries Required. The new data to be added to a list of time series. - * Adds at most one data point to each of several time series. The new data - * point must be more recent than any other point in its time series. Each - * `TimeSeries` value must fully specify a unique time series by supplying - * all label values for the metric and the monitored resource. - * - * The maximum number of `TimeSeries` objects per `Create` request is 200. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - */ - public function createServiceTimeSeries($name, $timeSeries, array $optionalArgs = []) - { - $request = new CreateTimeSeriesRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setTimeSeries($timeSeries); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateServiceTimeSeries', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Creates or adds data to one or more time series. - * The response is empty if all time series in the request were written. - * If any time series could not be written, a corresponding failure message is - * included in the error response. - * - * Sample code: - * ``` - * $metricServiceClient = new MetricServiceClient(); - * try { - * $formattedName = $metricServiceClient->projectName('[PROJECT]'); - * $timeSeries = []; - * $metricServiceClient->createTimeSeries($formattedName, $timeSeries); - * } finally { - * $metricServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on - * which to execute the request. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER] - * @param TimeSeries[] $timeSeries Required. The new data to be added to a list of time series. - * Adds at most one data point to each of several time series. The new data - * point must be more recent than any other point in its time series. Each - * `TimeSeries` value must fully specify a unique time series by supplying - * all label values for the metric and the monitored resource. - * - * The maximum number of `TimeSeries` objects per `Create` request is 200. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - */ - public function createTimeSeries($name, $timeSeries, array $optionalArgs = []) - { - $request = new CreateTimeSeriesRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setTimeSeries($timeSeries); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateTimeSeries', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes a metric descriptor. Only user-created - * [custom metrics](https://cloud.google.com/monitoring/custom-metrics) can be - * deleted. - * - * Sample code: - * ``` - * $metricServiceClient = new MetricServiceClient(); - * try { - * $formattedName = $metricServiceClient->metricDescriptorName('[PROJECT]', '[METRIC_DESCRIPTOR]'); - * $metricServiceClient->deleteMetricDescriptor($formattedName); - * } finally { - * $metricServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The metric descriptor on which to execute the request. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER]/metricDescriptors/[METRIC_ID] - * - * An example of `[METRIC_ID]` is: - * `"custom.googleapis.com/my_test_metric"`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - */ - public function deleteMetricDescriptor($name, array $optionalArgs = []) - { - $request = new DeleteMetricDescriptorRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteMetricDescriptor', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets a single metric descriptor. This method does not require a Workspace. - * - * Sample code: - * ``` - * $metricServiceClient = new MetricServiceClient(); - * try { - * $formattedName = $metricServiceClient->metricDescriptorName('[PROJECT]', '[METRIC_DESCRIPTOR]'); - * $response = $metricServiceClient->getMetricDescriptor($formattedName); - * } finally { - * $metricServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The metric descriptor on which to execute the request. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER]/metricDescriptors/[METRIC_ID] - * - * An example value of `[METRIC_ID]` is - * `"compute.googleapis.com/instance/disk/read_bytes_count"`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\Api\MetricDescriptor - * - * @throws ApiException if the remote call fails - */ - public function getMetricDescriptor($name, array $optionalArgs = []) - { - $request = new GetMetricDescriptorRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetMetricDescriptor', MetricDescriptor::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets a single monitored resource descriptor. This method does not require a Workspace. - * - * Sample code: - * ``` - * $metricServiceClient = new MetricServiceClient(); - * try { - * $formattedName = $metricServiceClient->monitoredResourceDescriptorName('[PROJECT]', '[MONITORED_RESOURCE_DESCRIPTOR]'); - * $response = $metricServiceClient->getMonitoredResourceDescriptor($formattedName); - * } finally { - * $metricServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The monitored resource descriptor to get. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER]/monitoredResourceDescriptors/[RESOURCE_TYPE] - * - * The `[RESOURCE_TYPE]` is a predefined type, such as - * `cloudsql_database`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\Api\MonitoredResourceDescriptor - * - * @throws ApiException if the remote call fails - */ - public function getMonitoredResourceDescriptor($name, array $optionalArgs = []) - { - $request = new GetMonitoredResourceDescriptorRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetMonitoredResourceDescriptor', MonitoredResourceDescriptor::class, $optionalArgs, $request)->wait(); - } - - /** - * Lists metric descriptors that match a filter. This method does not require a Workspace. - * - * Sample code: - * ``` - * $metricServiceClient = new MetricServiceClient(); - * try { - * $name = 'name'; - * // Iterate over pages of elements - * $pagedResponse = $metricServiceClient->listMetricDescriptors($name); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $metricServiceClient->listMetricDescriptors($name); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $metricServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on - * which to execute the request. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER] - * @param array $optionalArgs { - * Optional. - * - * @type string $filter - * If this field is empty, all custom and - * system-defined metric descriptors are returned. - * Otherwise, the [filter](https://cloud.google.com/monitoring/api/v3/filters) - * specifies which metric descriptors are to be - * returned. For example, the following filter matches all - * [custom metrics](https://cloud.google.com/monitoring/custom-metrics): - * - * metric.type = starts_with("custom.googleapis.com/") - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listMetricDescriptors($name, array $optionalArgs = []) - { - $request = new ListMetricDescriptorsRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListMetricDescriptors', $optionalArgs, ListMetricDescriptorsResponse::class, $request); - } - - /** - * Lists monitored resource descriptors that match a filter. This method does not require a Workspace. - * - * Sample code: - * ``` - * $metricServiceClient = new MetricServiceClient(); - * try { - * $name = 'name'; - * // Iterate over pages of elements - * $pagedResponse = $metricServiceClient->listMonitoredResourceDescriptors($name); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $metricServiceClient->listMonitoredResourceDescriptors($name); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $metricServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on - * which to execute the request. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER] - * @param array $optionalArgs { - * Optional. - * - * @type string $filter - * An optional [filter](https://cloud.google.com/monitoring/api/v3/filters) - * describing the descriptors to be returned. The filter can reference the - * descriptor's type and labels. For example, the following filter returns - * only Google Compute Engine descriptors that have an `id` label: - * - * resource.type = starts_with("gce_") AND resource.label:id - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listMonitoredResourceDescriptors($name, array $optionalArgs = []) - { - $request = new ListMonitoredResourceDescriptorsRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListMonitoredResourceDescriptors', $optionalArgs, ListMonitoredResourceDescriptorsResponse::class, $request); - } - - /** - * Lists time series that match a filter. This method does not require a Workspace. - * - * Sample code: - * ``` - * $metricServiceClient = new MetricServiceClient(); - * try { - * $formattedName = $metricServiceClient->workspaceName('[PROJECT]'); - * $filter = 'filter'; - * $interval = new TimeInterval(); - * $view = TimeSeriesView::FULL; - * // Iterate over pages of elements - * $pagedResponse = $metricServiceClient->listTimeSeries($formattedName, $filter, $interval, $view); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $metricServiceClient->listTimeSeries($formattedName, $filter, $interval, $view); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $metricServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name), - * organization or folder on which to execute the request. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER] - * organizations/[ORGANIZATION_ID] - * folders/[FOLDER_ID] - * @param string $filter Required. A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) - * that specifies which time series should be returned. The filter must - * specify a single metric type, and can additionally specify metric labels - * and other information. For example: - * - * metric.type = "compute.googleapis.com/instance/cpu/usage_time" AND - * metric.labels.instance_name = "my-instance-name" - * @param TimeInterval $interval Required. The time interval for which results should be returned. Only time series - * that contain data points in the specified interval are included - * in the response. - * @param int $view Required. Specifies which information is returned about the time series. - * For allowed values, use constants defined on {@see \Google\Cloud\Monitoring\V3\ListTimeSeriesRequest\TimeSeriesView} - * @param array $optionalArgs { - * Optional. - * - * @type Aggregation $aggregation - * Specifies the alignment of data points in individual time series as - * well as how to combine the retrieved time series across specified labels. - * - * By default (if no `aggregation` is explicitly specified), the raw time - * series data is returned. - * @type Aggregation $secondaryAggregation - * Apply a second aggregation after `aggregation` is applied. May only be - * specified if `aggregation` is specified. - * @type string $orderBy - * Unsupported: must be left blank. The points in each time series are - * currently returned in reverse time order (most recent to oldest). - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listTimeSeries($name, $filter, $interval, $view, array $optionalArgs = []) - { - $request = new ListTimeSeriesRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setFilter($filter); - $request->setInterval($interval); - $request->setView($view); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['aggregation'])) { - $request->setAggregation($optionalArgs['aggregation']); - } - - if (isset($optionalArgs['secondaryAggregation'])) { - $request->setSecondaryAggregation($optionalArgs['secondaryAggregation']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListTimeSeries', $optionalArgs, ListTimeSeriesResponse::class, $request); - } -} diff --git a/owl-bot-staging/Monitoring/v3/src/V3/Gapic/NotificationChannelServiceGapicClient.php b/owl-bot-staging/Monitoring/v3/src/V3/Gapic/NotificationChannelServiceGapicClient.php deleted file mode 100644 index a0947a58b8c..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/Gapic/NotificationChannelServiceGapicClient.php +++ /dev/null @@ -1,1068 +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. - */ -class NotificationChannelServiceGapicClient -{ - use GapicClientTrait; - - /** - * The name of the service. - */ - const SERVICE_NAME = 'google.monitoring.v3.NotificationChannelService'; - - /** - * The default address of the service. - */ - const SERVICE_ADDRESS = 'monitoring.googleapis.com'; - - /** - * The default port of the service. - */ - const DEFAULT_SERVICE_PORT = 443; - - /** - * The name of the code generator, to be included in the agent header. - */ - const CODEGEN_NAME = 'gapic'; - - /** - * The default scopes required by the service. - */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/monitoring', - 'https://www.googleapis.com/auth/monitoring.read', - ]; - - private static $folderChannelDescriptorNameTemplate; - - private static $folderNotificationChannelNameTemplate; - - private static $notificationChannelNameTemplate; - - private static $notificationChannelDescriptorNameTemplate; - - private static $organizationChannelDescriptorNameTemplate; - - private static $organizationNotificationChannelNameTemplate; - - private static $projectChannelDescriptorNameTemplate; - - private static $projectNotificationChannelNameTemplate; - - private static $pathTemplateMap; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'serviceAddress' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/notification_channel_service_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/notification_channel_service_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/notification_channel_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/notification_channel_service_rest_client_config.php', - ], - ], - ]; - } - - private static function getFolderChannelDescriptorNameTemplate() - { - if (self::$folderChannelDescriptorNameTemplate == null) { - self::$folderChannelDescriptorNameTemplate = new PathTemplate('folders/{folder}/notificationChannelDescriptors/{channel_descriptor}'); - } - - return self::$folderChannelDescriptorNameTemplate; - } - - private static function getFolderNotificationChannelNameTemplate() - { - if (self::$folderNotificationChannelNameTemplate == null) { - self::$folderNotificationChannelNameTemplate = new PathTemplate('folders/{folder}/notificationChannels/{notification_channel}'); - } - - return self::$folderNotificationChannelNameTemplate; - } - - private static function getNotificationChannelNameTemplate() - { - if (self::$notificationChannelNameTemplate == null) { - self::$notificationChannelNameTemplate = new PathTemplate('projects/{project}/notificationChannels/{notification_channel}'); - } - - return self::$notificationChannelNameTemplate; - } - - private static function getNotificationChannelDescriptorNameTemplate() - { - if (self::$notificationChannelDescriptorNameTemplate == null) { - self::$notificationChannelDescriptorNameTemplate = new PathTemplate('projects/{project}/notificationChannelDescriptors/{channel_descriptor}'); - } - - return self::$notificationChannelDescriptorNameTemplate; - } - - private static function getOrganizationChannelDescriptorNameTemplate() - { - if (self::$organizationChannelDescriptorNameTemplate == null) { - self::$organizationChannelDescriptorNameTemplate = new PathTemplate('organizations/{organization}/notificationChannelDescriptors/{channel_descriptor}'); - } - - return self::$organizationChannelDescriptorNameTemplate; - } - - private static function getOrganizationNotificationChannelNameTemplate() - { - if (self::$organizationNotificationChannelNameTemplate == null) { - self::$organizationNotificationChannelNameTemplate = new PathTemplate('organizations/{organization}/notificationChannels/{notification_channel}'); - } - - return self::$organizationNotificationChannelNameTemplate; - } - - private static function getProjectChannelDescriptorNameTemplate() - { - if (self::$projectChannelDescriptorNameTemplate == null) { - self::$projectChannelDescriptorNameTemplate = new PathTemplate('projects/{project}/notificationChannelDescriptors/{channel_descriptor}'); - } - - return self::$projectChannelDescriptorNameTemplate; - } - - private static function getProjectNotificationChannelNameTemplate() - { - if (self::$projectNotificationChannelNameTemplate == null) { - self::$projectNotificationChannelNameTemplate = new PathTemplate('projects/{project}/notificationChannels/{notification_channel}'); - } - - return self::$projectNotificationChannelNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'folderChannelDescriptor' => self::getFolderChannelDescriptorNameTemplate(), - 'folderNotificationChannel' => self::getFolderNotificationChannelNameTemplate(), - 'notificationChannel' => self::getNotificationChannelNameTemplate(), - 'notificationChannelDescriptor' => self::getNotificationChannelDescriptorNameTemplate(), - 'organizationChannelDescriptor' => self::getOrganizationChannelDescriptorNameTemplate(), - 'organizationNotificationChannel' => self::getOrganizationNotificationChannelNameTemplate(), - 'projectChannelDescriptor' => self::getProjectChannelDescriptorNameTemplate(), - 'projectNotificationChannel' => self::getProjectNotificationChannelNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a - * folder_channel_descriptor resource. - * - * @param string $folder - * @param string $channelDescriptor - * - * @return string The formatted folder_channel_descriptor resource. - */ - public static function folderChannelDescriptorName($folder, $channelDescriptor) - { - return self::getFolderChannelDescriptorNameTemplate()->render([ - 'folder' => $folder, - 'channel_descriptor' => $channelDescriptor, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * folder_notification_channel resource. - * - * @param string $folder - * @param string $notificationChannel - * - * @return string The formatted folder_notification_channel resource. - */ - public static function folderNotificationChannelName($folder, $notificationChannel) - { - return self::getFolderNotificationChannelNameTemplate()->render([ - 'folder' => $folder, - 'notification_channel' => $notificationChannel, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * notification_channel resource. - * - * @param string $project - * @param string $notificationChannel - * - * @return string The formatted notification_channel resource. - */ - public static function notificationChannelName($project, $notificationChannel) - { - return self::getNotificationChannelNameTemplate()->render([ - 'project' => $project, - 'notification_channel' => $notificationChannel, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * notification_channel_descriptor resource. - * - * @param string $project - * @param string $channelDescriptor - * - * @return string The formatted notification_channel_descriptor resource. - */ - public static function notificationChannelDescriptorName($project, $channelDescriptor) - { - return self::getNotificationChannelDescriptorNameTemplate()->render([ - 'project' => $project, - 'channel_descriptor' => $channelDescriptor, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * organization_channel_descriptor resource. - * - * @param string $organization - * @param string $channelDescriptor - * - * @return string The formatted organization_channel_descriptor resource. - */ - public static function organizationChannelDescriptorName($organization, $channelDescriptor) - { - return self::getOrganizationChannelDescriptorNameTemplate()->render([ - 'organization' => $organization, - 'channel_descriptor' => $channelDescriptor, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * organization_notification_channel resource. - * - * @param string $organization - * @param string $notificationChannel - * - * @return string The formatted organization_notification_channel resource. - */ - public static function organizationNotificationChannelName($organization, $notificationChannel) - { - return self::getOrganizationNotificationChannelNameTemplate()->render([ - 'organization' => $organization, - 'notification_channel' => $notificationChannel, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_channel_descriptor resource. - * - * @param string $project - * @param string $channelDescriptor - * - * @return string The formatted project_channel_descriptor resource. - */ - public static function projectChannelDescriptorName($project, $channelDescriptor) - { - return self::getProjectChannelDescriptorNameTemplate()->render([ - 'project' => $project, - 'channel_descriptor' => $channelDescriptor, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_notification_channel resource. - * - * @param string $project - * @param string $notificationChannel - * - * @return string The formatted project_notification_channel resource. - */ - public static function projectNotificationChannelName($project, $notificationChannel) - { - return self::getProjectNotificationChannelNameTemplate()->render([ - 'project' => $project, - 'notification_channel' => $notificationChannel, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - folderChannelDescriptor: folders/{folder}/notificationChannelDescriptors/{channel_descriptor} - * - folderNotificationChannel: folders/{folder}/notificationChannels/{notification_channel} - * - notificationChannel: projects/{project}/notificationChannels/{notification_channel} - * - notificationChannelDescriptor: projects/{project}/notificationChannelDescriptors/{channel_descriptor} - * - organizationChannelDescriptor: organizations/{organization}/notificationChannelDescriptors/{channel_descriptor} - * - organizationNotificationChannel: organizations/{organization}/notificationChannels/{notification_channel} - * - projectChannelDescriptor: projects/{project}/notificationChannelDescriptors/{channel_descriptor} - * - projectNotificationChannel: projects/{project}/notificationChannels/{notification_channel} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $serviceAddress - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'monitoring.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $serviceAddress setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * Creates a new notification channel, representing a single notification - * endpoint such as an email address, SMS number, or PagerDuty service. - * - * Sample code: - * ``` - * $notificationChannelServiceClient = new NotificationChannelServiceClient(); - * try { - * $name = 'name'; - * $notificationChannel = new NotificationChannel(); - * $response = $notificationChannelServiceClient->createNotificationChannel($name, $notificationChannel); - * } finally { - * $notificationChannelServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on - * which to execute the request. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER] - * - * This names the container into which the channel will be - * written, this does not name the newly created channel. The resulting - * channel's name will have a normalized version of this field as a prefix, - * but will add `/notificationChannels/[CHANNEL_ID]` to identify the channel. - * @param NotificationChannel $notificationChannel Required. The definition of the `NotificationChannel` to create. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Monitoring\V3\NotificationChannel - * - * @throws ApiException if the remote call fails - */ - public function createNotificationChannel($name, $notificationChannel, array $optionalArgs = []) - { - $request = new CreateNotificationChannelRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setNotificationChannel($notificationChannel); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateNotificationChannel', NotificationChannel::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes a notification channel. - * - * Sample code: - * ``` - * $notificationChannelServiceClient = new NotificationChannelServiceClient(); - * try { - * $formattedName = $notificationChannelServiceClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - * $notificationChannelServiceClient->deleteNotificationChannel($formattedName); - * } finally { - * $notificationChannelServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The channel for which to execute the request. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] - * @param array $optionalArgs { - * Optional. - * - * @type bool $force - * If true, the notification channel will be deleted regardless of its - * use in alert policies (the policies will be updated to remove the - * channel). If false, channels that are still referenced by an existing - * alerting policy will fail to be deleted in a delete operation. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - */ - public function deleteNotificationChannel($name, array $optionalArgs = []) - { - $request = new DeleteNotificationChannelRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['force'])) { - $request->setForce($optionalArgs['force']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteNotificationChannel', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets a single notification channel. The channel includes the relevant - * configuration details with which the channel was created. However, the - * response may truncate or omit passwords, API keys, or other private key - * matter and thus the response may not be 100% identical to the information - * that was supplied in the call to the create method. - * - * Sample code: - * ``` - * $notificationChannelServiceClient = new NotificationChannelServiceClient(); - * try { - * $formattedName = $notificationChannelServiceClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - * $response = $notificationChannelServiceClient->getNotificationChannel($formattedName); - * } finally { - * $notificationChannelServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The channel for which to execute the request. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Monitoring\V3\NotificationChannel - * - * @throws ApiException if the remote call fails - */ - public function getNotificationChannel($name, array $optionalArgs = []) - { - $request = new GetNotificationChannelRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetNotificationChannel', NotificationChannel::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets a single channel descriptor. The descriptor indicates which fields - * are expected / permitted for a notification channel of the given type. - * - * Sample code: - * ``` - * $notificationChannelServiceClient = new NotificationChannelServiceClient(); - * try { - * $formattedName = $notificationChannelServiceClient->notificationChannelDescriptorName('[PROJECT]', '[CHANNEL_DESCRIPTOR]'); - * $response = $notificationChannelServiceClient->getNotificationChannelDescriptor($formattedName); - * } finally { - * $notificationChannelServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The channel type for which to execute the request. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER]/notificationChannelDescriptors/[CHANNEL_TYPE] - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Monitoring\V3\NotificationChannelDescriptor - * - * @throws ApiException if the remote call fails - */ - public function getNotificationChannelDescriptor($name, array $optionalArgs = []) - { - $request = new GetNotificationChannelDescriptorRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetNotificationChannelDescriptor', NotificationChannelDescriptor::class, $optionalArgs, $request)->wait(); - } - - /** - * Requests a verification code for an already verified channel that can then - * be used in a call to VerifyNotificationChannel() on a different channel - * with an equivalent identity in the same or in a different project. This - * makes it possible to copy a channel between projects without requiring - * manual reverification of the channel. If the channel is not in the - * verified state, this method will fail (in other words, this may only be - * used if the SendNotificationChannelVerificationCode and - * VerifyNotificationChannel paths have already been used to put the given - * channel into the verified state). - * - * There is no guarantee that the verification codes returned by this method - * will be of a similar structure or form as the ones that are delivered - * to the channel via SendNotificationChannelVerificationCode; while - * VerifyNotificationChannel() will recognize both the codes delivered via - * SendNotificationChannelVerificationCode() and returned from - * GetNotificationChannelVerificationCode(), it is typically the case that - * the verification codes delivered via - * SendNotificationChannelVerificationCode() will be shorter and also - * have a shorter expiration (e.g. codes such as "G-123456") whereas - * GetVerificationCode() will typically return a much longer, websafe base - * 64 encoded string that has a longer expiration time. - * - * Sample code: - * ``` - * $notificationChannelServiceClient = new NotificationChannelServiceClient(); - * try { - * $formattedName = $notificationChannelServiceClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - * $response = $notificationChannelServiceClient->getNotificationChannelVerificationCode($formattedName); - * } finally { - * $notificationChannelServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The notification channel for which a verification code is to be generated - * and retrieved. This must name a channel that is already verified; if - * the specified channel is not verified, the request will fail. - * @param array $optionalArgs { - * Optional. - * - * @type Timestamp $expireTime - * The desired expiration time. If specified, the API will guarantee that - * the returned code will not be valid after the specified timestamp; - * however, the API cannot guarantee that the returned code will be - * valid for at least as long as the requested time (the API puts an upper - * bound on the amount of time for which a code may be valid). If omitted, - * a default expiration will be used, which may be less than the max - * permissible expiration (so specifying an expiration may extend the - * code's lifetime over omitting an expiration, even though the API does - * impose an upper limit on the maximum expiration that is permitted). - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Monitoring\V3\GetNotificationChannelVerificationCodeResponse - * - * @throws ApiException if the remote call fails - */ - public function getNotificationChannelVerificationCode($name, array $optionalArgs = []) - { - $request = new GetNotificationChannelVerificationCodeRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['expireTime'])) { - $request->setExpireTime($optionalArgs['expireTime']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetNotificationChannelVerificationCode', GetNotificationChannelVerificationCodeResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Lists the descriptors for supported channel types. The use of descriptors - * makes it possible for new channel types to be dynamically added. - * - * Sample code: - * ``` - * $notificationChannelServiceClient = new NotificationChannelServiceClient(); - * try { - * $name = 'name'; - * // Iterate over pages of elements - * $pagedResponse = $notificationChannelServiceClient->listNotificationChannelDescriptors($name); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $notificationChannelServiceClient->listNotificationChannelDescriptors($name); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $notificationChannelServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The REST resource name of the parent from which to retrieve - * the notification channel descriptors. The expected syntax is: - * - * projects/[PROJECT_ID_OR_NUMBER] - * - * Note that this - * [names](https://cloud.google.com/monitoring/api/v3#project_name) the parent - * container in which to look for the descriptors; to retrieve a single - * descriptor by name, use the - * [GetNotificationChannelDescriptor][google.monitoring.v3.NotificationChannelService.GetNotificationChannelDescriptor] - * operation, instead. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listNotificationChannelDescriptors($name, array $optionalArgs = []) - { - $request = new ListNotificationChannelDescriptorsRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListNotificationChannelDescriptors', $optionalArgs, ListNotificationChannelDescriptorsResponse::class, $request); - } - - /** - * Lists the notification channels that have been created for the project. - * - * Sample code: - * ``` - * $notificationChannelServiceClient = new NotificationChannelServiceClient(); - * try { - * $name = 'name'; - * // Iterate over pages of elements - * $pagedResponse = $notificationChannelServiceClient->listNotificationChannels($name); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $notificationChannelServiceClient->listNotificationChannels($name); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $notificationChannelServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on - * which to execute the request. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER] - * - * This names the container - * in which to look for the notification channels; it does not name a - * specific channel. To query a specific channel by REST resource name, use - * the - * [`GetNotificationChannel`][google.monitoring.v3.NotificationChannelService.GetNotificationChannel] - * operation. - * @param array $optionalArgs { - * Optional. - * - * @type string $filter - * If provided, this field specifies the criteria that must be met by - * notification channels to be included in the response. - * - * For more details, see [sorting and - * filtering](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering). - * @type string $orderBy - * A comma-separated list of fields by which to sort the result. Supports - * the same set of fields as in `filter`. Entries can be prefixed with - * a minus sign to sort in descending rather than ascending order. - * - * For more details, see [sorting and - * filtering](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering). - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listNotificationChannels($name, array $optionalArgs = []) - { - $request = new ListNotificationChannelsRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListNotificationChannels', $optionalArgs, ListNotificationChannelsResponse::class, $request); - } - - /** - * Causes a verification code to be delivered to the channel. The code - * can then be supplied in `VerifyNotificationChannel` to verify the channel. - * - * Sample code: - * ``` - * $notificationChannelServiceClient = new NotificationChannelServiceClient(); - * try { - * $formattedName = $notificationChannelServiceClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - * $notificationChannelServiceClient->sendNotificationChannelVerificationCode($formattedName); - * } finally { - * $notificationChannelServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The notification channel to which to send a verification code. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - */ - public function sendNotificationChannelVerificationCode($name, array $optionalArgs = []) - { - $request = new SendNotificationChannelVerificationCodeRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('SendNotificationChannelVerificationCode', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Updates a notification channel. Fields not specified in the field mask - * remain unchanged. - * - * Sample code: - * ``` - * $notificationChannelServiceClient = new NotificationChannelServiceClient(); - * try { - * $notificationChannel = new NotificationChannel(); - * $response = $notificationChannelServiceClient->updateNotificationChannel($notificationChannel); - * } finally { - * $notificationChannelServiceClient->close(); - * } - * ``` - * - * @param NotificationChannel $notificationChannel Required. A description of the changes to be applied to the specified - * notification channel. The description must provide a definition for - * fields to be updated; the names of these fields should also be - * included in the `update_mask`. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * The fields to update. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Monitoring\V3\NotificationChannel - * - * @throws ApiException if the remote call fails - */ - public function updateNotificationChannel($notificationChannel, array $optionalArgs = []) - { - $request = new UpdateNotificationChannelRequest(); - $requestParamHeaders = []; - $request->setNotificationChannel($notificationChannel); - $requestParamHeaders['notification_channel.name'] = $notificationChannel->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateNotificationChannel', NotificationChannel::class, $optionalArgs, $request)->wait(); - } - - /** - * Verifies a `NotificationChannel` by proving receipt of the code - * delivered to the channel as a result of calling - * `SendNotificationChannelVerificationCode`. - * - * Sample code: - * ``` - * $notificationChannelServiceClient = new NotificationChannelServiceClient(); - * try { - * $formattedName = $notificationChannelServiceClient->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - * $code = 'code'; - * $response = $notificationChannelServiceClient->verifyNotificationChannel($formattedName, $code); - * } finally { - * $notificationChannelServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The notification channel to verify. - * @param string $code Required. The verification code that was delivered to the channel as - * a result of invoking the `SendNotificationChannelVerificationCode` API - * method or that was retrieved from a verified channel via - * `GetNotificationChannelVerificationCode`. For example, one might have - * "G-123456" or "TKNZGhhd2EyN3I1MnRnMjRv" (in general, one is only - * guaranteed that the code is valid UTF-8; one should not - * make any assumptions regarding the structure or format of the code). - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Monitoring\V3\NotificationChannel - * - * @throws ApiException if the remote call fails - */ - public function verifyNotificationChannel($name, $code, array $optionalArgs = []) - { - $request = new VerifyNotificationChannelRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setCode($code); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('VerifyNotificationChannel', NotificationChannel::class, $optionalArgs, $request)->wait(); - } -} diff --git a/owl-bot-staging/Monitoring/v3/src/V3/Gapic/ServiceMonitoringServiceGapicClient.php b/owl-bot-staging/Monitoring/v3/src/V3/Gapic/ServiceMonitoringServiceGapicClient.php deleted file mode 100644 index a8b1df427af..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/Gapic/ServiceMonitoringServiceGapicClient.php +++ /dev/null @@ -1,1054 +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. - */ -class ServiceMonitoringServiceGapicClient -{ - use GapicClientTrait; - - /** - * The name of the service. - */ - const SERVICE_NAME = 'google.monitoring.v3.ServiceMonitoringService'; - - /** - * The default address of the service. - */ - const SERVICE_ADDRESS = 'monitoring.googleapis.com'; - - /** - * The default port of the service. - */ - const DEFAULT_SERVICE_PORT = 443; - - /** - * The name of the code generator, to be included in the agent header. - */ - const CODEGEN_NAME = 'gapic'; - - /** - * The default scopes required by the service. - */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/monitoring', - 'https://www.googleapis.com/auth/monitoring.read', - ]; - - private static $folderServiceNameTemplate; - - private static $folderServiceServiceLevelObjectiveNameTemplate; - - private static $organizationServiceNameTemplate; - - private static $organizationServiceServiceLevelObjectiveNameTemplate; - - private static $projectServiceNameTemplate; - - private static $projectServiceServiceLevelObjectiveNameTemplate; - - private static $serviceNameTemplate; - - private static $serviceLevelObjectiveNameTemplate; - - private static $pathTemplateMap; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'serviceAddress' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/service_monitoring_service_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/service_monitoring_service_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/service_monitoring_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/service_monitoring_service_rest_client_config.php', - ], - ], - ]; - } - - private static function getFolderServiceNameTemplate() - { - if (self::$folderServiceNameTemplate == null) { - self::$folderServiceNameTemplate = new PathTemplate('folders/{folder}/services/{service}'); - } - - return self::$folderServiceNameTemplate; - } - - private static function getFolderServiceServiceLevelObjectiveNameTemplate() - { - if (self::$folderServiceServiceLevelObjectiveNameTemplate == null) { - self::$folderServiceServiceLevelObjectiveNameTemplate = new PathTemplate('folders/{folder}/services/{service}/serviceLevelObjectives/{service_level_objective}'); - } - - return self::$folderServiceServiceLevelObjectiveNameTemplate; - } - - private static function getOrganizationServiceNameTemplate() - { - if (self::$organizationServiceNameTemplate == null) { - self::$organizationServiceNameTemplate = new PathTemplate('organizations/{organization}/services/{service}'); - } - - return self::$organizationServiceNameTemplate; - } - - private static function getOrganizationServiceServiceLevelObjectiveNameTemplate() - { - if (self::$organizationServiceServiceLevelObjectiveNameTemplate == null) { - self::$organizationServiceServiceLevelObjectiveNameTemplate = new PathTemplate('organizations/{organization}/services/{service}/serviceLevelObjectives/{service_level_objective}'); - } - - return self::$organizationServiceServiceLevelObjectiveNameTemplate; - } - - private static function getProjectServiceNameTemplate() - { - if (self::$projectServiceNameTemplate == null) { - self::$projectServiceNameTemplate = new PathTemplate('projects/{project}/services/{service}'); - } - - return self::$projectServiceNameTemplate; - } - - private static function getProjectServiceServiceLevelObjectiveNameTemplate() - { - if (self::$projectServiceServiceLevelObjectiveNameTemplate == null) { - self::$projectServiceServiceLevelObjectiveNameTemplate = new PathTemplate('projects/{project}/services/{service}/serviceLevelObjectives/{service_level_objective}'); - } - - return self::$projectServiceServiceLevelObjectiveNameTemplate; - } - - private static function getServiceNameTemplate() - { - if (self::$serviceNameTemplate == null) { - self::$serviceNameTemplate = new PathTemplate('projects/{project}/services/{service}'); - } - - return self::$serviceNameTemplate; - } - - private static function getServiceLevelObjectiveNameTemplate() - { - if (self::$serviceLevelObjectiveNameTemplate == null) { - self::$serviceLevelObjectiveNameTemplate = new PathTemplate('projects/{project}/services/{service}/serviceLevelObjectives/{service_level_objective}'); - } - - return self::$serviceLevelObjectiveNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'folderService' => self::getFolderServiceNameTemplate(), - 'folderServiceServiceLevelObjective' => self::getFolderServiceServiceLevelObjectiveNameTemplate(), - 'organizationService' => self::getOrganizationServiceNameTemplate(), - 'organizationServiceServiceLevelObjective' => self::getOrganizationServiceServiceLevelObjectiveNameTemplate(), - 'projectService' => self::getProjectServiceNameTemplate(), - 'projectServiceServiceLevelObjective' => self::getProjectServiceServiceLevelObjectiveNameTemplate(), - 'service' => self::getServiceNameTemplate(), - 'serviceLevelObjective' => self::getServiceLevelObjectiveNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a - * folder_service resource. - * - * @param string $folder - * @param string $service - * - * @return string The formatted folder_service resource. - */ - public static function folderServiceName($folder, $service) - { - return self::getFolderServiceNameTemplate()->render([ - 'folder' => $folder, - 'service' => $service, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * folder_service_service_level_objective resource. - * - * @param string $folder - * @param string $service - * @param string $serviceLevelObjective - * - * @return string The formatted folder_service_service_level_objective resource. - */ - public static function folderServiceServiceLevelObjectiveName($folder, $service, $serviceLevelObjective) - { - return self::getFolderServiceServiceLevelObjectiveNameTemplate()->render([ - 'folder' => $folder, - 'service' => $service, - 'service_level_objective' => $serviceLevelObjective, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * organization_service resource. - * - * @param string $organization - * @param string $service - * - * @return string The formatted organization_service resource. - */ - public static function organizationServiceName($organization, $service) - { - return self::getOrganizationServiceNameTemplate()->render([ - 'organization' => $organization, - 'service' => $service, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * organization_service_service_level_objective resource. - * - * @param string $organization - * @param string $service - * @param string $serviceLevelObjective - * - * @return string The formatted organization_service_service_level_objective resource. - */ - public static function organizationServiceServiceLevelObjectiveName($organization, $service, $serviceLevelObjective) - { - return self::getOrganizationServiceServiceLevelObjectiveNameTemplate()->render([ - 'organization' => $organization, - 'service' => $service, - 'service_level_objective' => $serviceLevelObjective, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_service resource. - * - * @param string $project - * @param string $service - * - * @return string The formatted project_service resource. - */ - public static function projectServiceName($project, $service) - { - return self::getProjectServiceNameTemplate()->render([ - 'project' => $project, - 'service' => $service, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_service_service_level_objective resource. - * - * @param string $project - * @param string $service - * @param string $serviceLevelObjective - * - * @return string The formatted project_service_service_level_objective resource. - */ - public static function projectServiceServiceLevelObjectiveName($project, $service, $serviceLevelObjective) - { - return self::getProjectServiceServiceLevelObjectiveNameTemplate()->render([ - 'project' => $project, - 'service' => $service, - 'service_level_objective' => $serviceLevelObjective, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a service - * resource. - * - * @param string $project - * @param string $service - * - * @return string The formatted service resource. - */ - public static function serviceName($project, $service) - { - return self::getServiceNameTemplate()->render([ - 'project' => $project, - 'service' => $service, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * service_level_objective resource. - * - * @param string $project - * @param string $service - * @param string $serviceLevelObjective - * - * @return string The formatted service_level_objective resource. - */ - public static function serviceLevelObjectiveName($project, $service, $serviceLevelObjective) - { - return self::getServiceLevelObjectiveNameTemplate()->render([ - 'project' => $project, - 'service' => $service, - 'service_level_objective' => $serviceLevelObjective, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - folderService: folders/{folder}/services/{service} - * - folderServiceServiceLevelObjective: folders/{folder}/services/{service}/serviceLevelObjectives/{service_level_objective} - * - organizationService: organizations/{organization}/services/{service} - * - organizationServiceServiceLevelObjective: organizations/{organization}/services/{service}/serviceLevelObjectives/{service_level_objective} - * - projectService: projects/{project}/services/{service} - * - projectServiceServiceLevelObjective: projects/{project}/services/{service}/serviceLevelObjectives/{service_level_objective} - * - service: projects/{project}/services/{service} - * - serviceLevelObjective: projects/{project}/services/{service}/serviceLevelObjectives/{service_level_objective} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $serviceAddress - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'monitoring.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $serviceAddress setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * Create a `Service`. - * - * Sample code: - * ``` - * $serviceMonitoringServiceClient = new ServiceMonitoringServiceClient(); - * try { - * $parent = 'parent'; - * $service = new Service(); - * $response = $serviceMonitoringServiceClient->createService($parent, $service); - * } finally { - * $serviceMonitoringServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. Resource [name](https://cloud.google.com/monitoring/api/v3#project_name) of - * the parent workspace. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER] - * @param Service $service Required. The `Service` to create. - * @param array $optionalArgs { - * Optional. - * - * @type string $serviceId - * Optional. The Service id to use for this Service. If omitted, an id will be - * generated instead. Must match the pattern `[a-z0-9\-]+` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Monitoring\V3\Service - * - * @throws ApiException if the remote call fails - */ - public function createService($parent, $service, array $optionalArgs = []) - { - $request = new CreateServiceRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setService($service); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['serviceId'])) { - $request->setServiceId($optionalArgs['serviceId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateService', Service::class, $optionalArgs, $request)->wait(); - } - - /** - * Create a `ServiceLevelObjective` for the given `Service`. - * - * Sample code: - * ``` - * $serviceMonitoringServiceClient = new ServiceMonitoringServiceClient(); - * try { - * $formattedParent = $serviceMonitoringServiceClient->serviceName('[PROJECT]', '[SERVICE]'); - * $serviceLevelObjective = new ServiceLevelObjective(); - * $response = $serviceMonitoringServiceClient->createServiceLevelObjective($formattedParent, $serviceLevelObjective); - * } finally { - * $serviceMonitoringServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. Resource name of the parent `Service`. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] - * @param ServiceLevelObjective $serviceLevelObjective Required. The `ServiceLevelObjective` to create. - * The provided `name` will be respected if no `ServiceLevelObjective` exists - * with this name. - * @param array $optionalArgs { - * Optional. - * - * @type string $serviceLevelObjectiveId - * Optional. The ServiceLevelObjective id to use for this - * ServiceLevelObjective. If omitted, an id will be generated instead. Must - * match the pattern `[a-z0-9\-]+` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Monitoring\V3\ServiceLevelObjective - * - * @throws ApiException if the remote call fails - */ - public function createServiceLevelObjective($parent, $serviceLevelObjective, array $optionalArgs = []) - { - $request = new CreateServiceLevelObjectiveRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setServiceLevelObjective($serviceLevelObjective); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['serviceLevelObjectiveId'])) { - $request->setServiceLevelObjectiveId($optionalArgs['serviceLevelObjectiveId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateServiceLevelObjective', ServiceLevelObjective::class, $optionalArgs, $request)->wait(); - } - - /** - * Soft delete this `Service`. - * - * Sample code: - * ``` - * $serviceMonitoringServiceClient = new ServiceMonitoringServiceClient(); - * try { - * $formattedName = $serviceMonitoringServiceClient->serviceName('[PROJECT]', '[SERVICE]'); - * $serviceMonitoringServiceClient->deleteService($formattedName); - * } finally { - * $serviceMonitoringServiceClient->close(); - * } - * ``` - * - * @param string $name Required. Resource name of the `Service` to delete. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - */ - public function deleteService($name, array $optionalArgs = []) - { - $request = new DeleteServiceRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteService', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Delete the given `ServiceLevelObjective`. - * - * Sample code: - * ``` - * $serviceMonitoringServiceClient = new ServiceMonitoringServiceClient(); - * try { - * $formattedName = $serviceMonitoringServiceClient->serviceLevelObjectiveName('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]'); - * $serviceMonitoringServiceClient->deleteServiceLevelObjective($formattedName); - * } finally { - * $serviceMonitoringServiceClient->close(); - * } - * ``` - * - * @param string $name Required. Resource name of the `ServiceLevelObjective` to delete. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjectives/[SLO_NAME] - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - */ - public function deleteServiceLevelObjective($name, array $optionalArgs = []) - { - $request = new DeleteServiceLevelObjectiveRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteServiceLevelObjective', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Get the named `Service`. - * - * Sample code: - * ``` - * $serviceMonitoringServiceClient = new ServiceMonitoringServiceClient(); - * try { - * $formattedName = $serviceMonitoringServiceClient->serviceName('[PROJECT]', '[SERVICE]'); - * $response = $serviceMonitoringServiceClient->getService($formattedName); - * } finally { - * $serviceMonitoringServiceClient->close(); - * } - * ``` - * - * @param string $name Required. Resource name of the `Service`. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Monitoring\V3\Service - * - * @throws ApiException if the remote call fails - */ - public function getService($name, array $optionalArgs = []) - { - $request = new GetServiceRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetService', Service::class, $optionalArgs, $request)->wait(); - } - - /** - * Get a `ServiceLevelObjective` by name. - * - * Sample code: - * ``` - * $serviceMonitoringServiceClient = new ServiceMonitoringServiceClient(); - * try { - * $formattedName = $serviceMonitoringServiceClient->serviceLevelObjectiveName('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]'); - * $response = $serviceMonitoringServiceClient->getServiceLevelObjective($formattedName); - * } finally { - * $serviceMonitoringServiceClient->close(); - * } - * ``` - * - * @param string $name Required. Resource name of the `ServiceLevelObjective` to get. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjectives/[SLO_NAME] - * @param array $optionalArgs { - * Optional. - * - * @type int $view - * View of the `ServiceLevelObjective` to return. If `DEFAULT`, return the - * `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the - * `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the - * `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed. - * For allowed values, use constants defined on {@see \Google\Cloud\Monitoring\V3\ServiceLevelObjective\View} - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Monitoring\V3\ServiceLevelObjective - * - * @throws ApiException if the remote call fails - */ - public function getServiceLevelObjective($name, array $optionalArgs = []) - { - $request = new GetServiceLevelObjectiveRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['view'])) { - $request->setView($optionalArgs['view']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetServiceLevelObjective', ServiceLevelObjective::class, $optionalArgs, $request)->wait(); - } - - /** - * List the `ServiceLevelObjective`s for the given `Service`. - * - * Sample code: - * ``` - * $serviceMonitoringServiceClient = new ServiceMonitoringServiceClient(); - * try { - * $formattedParent = $serviceMonitoringServiceClient->serviceName('[PROJECT]', '[SERVICE]'); - * // Iterate over pages of elements - * $pagedResponse = $serviceMonitoringServiceClient->listServiceLevelObjectives($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $serviceMonitoringServiceClient->listServiceLevelObjectives($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $serviceMonitoringServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. Resource name of the parent containing the listed SLOs, either a - * project or a Monitoring Workspace. The formats are: - * - * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] - * workspaces/[HOST_PROJECT_ID_OR_NUMBER]/services/- - * @param array $optionalArgs { - * Optional. - * - * @type string $filter - * A filter specifying what `ServiceLevelObjective`s to return. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type int $view - * View of the `ServiceLevelObjective`s to return. If `DEFAULT`, return each - * `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the - * `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the - * `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed. - * For allowed values, use constants defined on {@see \Google\Cloud\Monitoring\V3\ServiceLevelObjective\View} - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listServiceLevelObjectives($parent, array $optionalArgs = []) - { - $request = new ListServiceLevelObjectivesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['view'])) { - $request->setView($optionalArgs['view']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListServiceLevelObjectives', $optionalArgs, ListServiceLevelObjectivesResponse::class, $request); - } - - /** - * List `Service`s for this workspace. - * - * Sample code: - * ``` - * $serviceMonitoringServiceClient = new ServiceMonitoringServiceClient(); - * try { - * $parent = 'parent'; - * // Iterate over pages of elements - * $pagedResponse = $serviceMonitoringServiceClient->listServices($parent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $serviceMonitoringServiceClient->listServices($parent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $serviceMonitoringServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. Resource name of the parent containing the listed services, either a - * [project](https://cloud.google.com/monitoring/api/v3#project_name) or a - * Monitoring Workspace. The formats are: - * - * projects/[PROJECT_ID_OR_NUMBER] - * workspaces/[HOST_PROJECT_ID_OR_NUMBER] - * @param array $optionalArgs { - * Optional. - * - * @type string $filter - * A filter specifying what `Service`s to return. The filter currently - * supports the following fields: - * - * - `identifier_case` - * - `app_engine.module_id` - * - `cloud_endpoints.service` (reserved for future use) - * - `mesh_istio.mesh_uid` - * - `mesh_istio.service_namespace` - * - `mesh_istio.service_name` - * - `cluster_istio.location` (deprecated) - * - `cluster_istio.cluster_name` (deprecated) - * - `cluster_istio.service_namespace` (deprecated) - * - `cluster_istio.service_name` (deprecated) - * - * `identifier_case` refers to which option in the identifier oneof is - * populated. For example, the filter `identifier_case = "CUSTOM"` would match - * all services with a value for the `custom` field. Valid options are - * "CUSTOM", "APP_ENGINE", "MESH_ISTIO", plus "CLUSTER_ISTIO" (deprecated) - * and "CLOUD_ENDPOINTS" (reserved for future use). - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listServices($parent, array $optionalArgs = []) - { - $request = new ListServicesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListServices', $optionalArgs, ListServicesResponse::class, $request); - } - - /** - * Update this `Service`. - * - * Sample code: - * ``` - * $serviceMonitoringServiceClient = new ServiceMonitoringServiceClient(); - * try { - * $service = new Service(); - * $response = $serviceMonitoringServiceClient->updateService($service); - * } finally { - * $serviceMonitoringServiceClient->close(); - * } - * ``` - * - * @param Service $service Required. The `Service` to draw updates from. - * The given `name` specifies the resource to update. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * A set of field paths defining which fields to use for the update. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Monitoring\V3\Service - * - * @throws ApiException if the remote call fails - */ - public function updateService($service, array $optionalArgs = []) - { - $request = new UpdateServiceRequest(); - $requestParamHeaders = []; - $request->setService($service); - $requestParamHeaders['service.name'] = $service->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateService', Service::class, $optionalArgs, $request)->wait(); - } - - /** - * Update the given `ServiceLevelObjective`. - * - * Sample code: - * ``` - * $serviceMonitoringServiceClient = new ServiceMonitoringServiceClient(); - * try { - * $serviceLevelObjective = new ServiceLevelObjective(); - * $response = $serviceMonitoringServiceClient->updateServiceLevelObjective($serviceLevelObjective); - * } finally { - * $serviceMonitoringServiceClient->close(); - * } - * ``` - * - * @param ServiceLevelObjective $serviceLevelObjective Required. The `ServiceLevelObjective` to draw updates from. - * The given `name` specifies the resource to update. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * A set of field paths defining which fields to use for the update. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Monitoring\V3\ServiceLevelObjective - * - * @throws ApiException if the remote call fails - */ - public function updateServiceLevelObjective($serviceLevelObjective, array $optionalArgs = []) - { - $request = new UpdateServiceLevelObjectiveRequest(); - $requestParamHeaders = []; - $request->setServiceLevelObjective($serviceLevelObjective); - $requestParamHeaders['service_level_objective.name'] = $serviceLevelObjective->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateServiceLevelObjective', ServiceLevelObjective::class, $optionalArgs, $request)->wait(); - } -} diff --git a/owl-bot-staging/Monitoring/v3/src/V3/Gapic/UptimeCheckServiceGapicClient.php b/owl-bot-staging/Monitoring/v3/src/V3/Gapic/UptimeCheckServiceGapicClient.php deleted file mode 100644 index 56fd169abab..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/Gapic/UptimeCheckServiceGapicClient.php +++ /dev/null @@ -1,688 +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. - */ -class UptimeCheckServiceGapicClient -{ - use GapicClientTrait; - - /** - * The name of the service. - */ - const SERVICE_NAME = 'google.monitoring.v3.UptimeCheckService'; - - /** - * The default address of the service. - */ - const SERVICE_ADDRESS = 'monitoring.googleapis.com'; - - /** - * The default port of the service. - */ - const DEFAULT_SERVICE_PORT = 443; - - /** - * The name of the code generator, to be included in the agent header. - */ - const CODEGEN_NAME = 'gapic'; - - /** - * The default scopes required by the service. - */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/monitoring', - 'https://www.googleapis.com/auth/monitoring.read', - ]; - - private static $folderUptimeCheckConfigNameTemplate; - - private static $organizationUptimeCheckConfigNameTemplate; - - private static $projectUptimeCheckConfigNameTemplate; - - private static $uptimeCheckConfigNameTemplate; - - private static $pathTemplateMap; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'serviceAddress' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/uptime_check_service_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/uptime_check_service_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/uptime_check_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/uptime_check_service_rest_client_config.php', - ], - ], - ]; - } - - private static function getFolderUptimeCheckConfigNameTemplate() - { - if (self::$folderUptimeCheckConfigNameTemplate == null) { - self::$folderUptimeCheckConfigNameTemplate = new PathTemplate('folders/{folder}/uptimeCheckConfigs/{uptime_check_config}'); - } - - return self::$folderUptimeCheckConfigNameTemplate; - } - - private static function getOrganizationUptimeCheckConfigNameTemplate() - { - if (self::$organizationUptimeCheckConfigNameTemplate == null) { - self::$organizationUptimeCheckConfigNameTemplate = new PathTemplate('organizations/{organization}/uptimeCheckConfigs/{uptime_check_config}'); - } - - return self::$organizationUptimeCheckConfigNameTemplate; - } - - private static function getProjectUptimeCheckConfigNameTemplate() - { - if (self::$projectUptimeCheckConfigNameTemplate == null) { - self::$projectUptimeCheckConfigNameTemplate = new PathTemplate('projects/{project}/uptimeCheckConfigs/{uptime_check_config}'); - } - - return self::$projectUptimeCheckConfigNameTemplate; - } - - private static function getUptimeCheckConfigNameTemplate() - { - if (self::$uptimeCheckConfigNameTemplate == null) { - self::$uptimeCheckConfigNameTemplate = new PathTemplate('projects/{project}/uptimeCheckConfigs/{uptime_check_config}'); - } - - return self::$uptimeCheckConfigNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'folderUptimeCheckConfig' => self::getFolderUptimeCheckConfigNameTemplate(), - 'organizationUptimeCheckConfig' => self::getOrganizationUptimeCheckConfigNameTemplate(), - 'projectUptimeCheckConfig' => self::getProjectUptimeCheckConfigNameTemplate(), - 'uptimeCheckConfig' => self::getUptimeCheckConfigNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a - * folder_uptime_check_config resource. - * - * @param string $folder - * @param string $uptimeCheckConfig - * - * @return string The formatted folder_uptime_check_config resource. - */ - public static function folderUptimeCheckConfigName($folder, $uptimeCheckConfig) - { - return self::getFolderUptimeCheckConfigNameTemplate()->render([ - 'folder' => $folder, - 'uptime_check_config' => $uptimeCheckConfig, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * organization_uptime_check_config resource. - * - * @param string $organization - * @param string $uptimeCheckConfig - * - * @return string The formatted organization_uptime_check_config resource. - */ - public static function organizationUptimeCheckConfigName($organization, $uptimeCheckConfig) - { - return self::getOrganizationUptimeCheckConfigNameTemplate()->render([ - 'organization' => $organization, - 'uptime_check_config' => $uptimeCheckConfig, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_uptime_check_config resource. - * - * @param string $project - * @param string $uptimeCheckConfig - * - * @return string The formatted project_uptime_check_config resource. - */ - public static function projectUptimeCheckConfigName($project, $uptimeCheckConfig) - { - return self::getProjectUptimeCheckConfigNameTemplate()->render([ - 'project' => $project, - 'uptime_check_config' => $uptimeCheckConfig, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * uptime_check_config resource. - * - * @param string $project - * @param string $uptimeCheckConfig - * - * @return string The formatted uptime_check_config resource. - */ - public static function uptimeCheckConfigName($project, $uptimeCheckConfig) - { - return self::getUptimeCheckConfigNameTemplate()->render([ - 'project' => $project, - 'uptime_check_config' => $uptimeCheckConfig, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - folderUptimeCheckConfig: folders/{folder}/uptimeCheckConfigs/{uptime_check_config} - * - organizationUptimeCheckConfig: organizations/{organization}/uptimeCheckConfigs/{uptime_check_config} - * - projectUptimeCheckConfig: projects/{project}/uptimeCheckConfigs/{uptime_check_config} - * - uptimeCheckConfig: projects/{project}/uptimeCheckConfigs/{uptime_check_config} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $serviceAddress - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'monitoring.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $serviceAddress setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * Creates a new Uptime check configuration. - * - * Sample code: - * ``` - * $uptimeCheckServiceClient = new UptimeCheckServiceClient(); - * try { - * $parent = 'parent'; - * $uptimeCheckConfig = new UptimeCheckConfig(); - * $response = $uptimeCheckServiceClient->createUptimeCheckConfig($parent, $uptimeCheckConfig); - * } finally { - * $uptimeCheckServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) in - * which to create the Uptime check. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER] - * @param UptimeCheckConfig $uptimeCheckConfig Required. The new Uptime check configuration. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Monitoring\V3\UptimeCheckConfig - * - * @throws ApiException if the remote call fails - */ - public function createUptimeCheckConfig($parent, $uptimeCheckConfig, array $optionalArgs = []) - { - $request = new CreateUptimeCheckConfigRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setUptimeCheckConfig($uptimeCheckConfig); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateUptimeCheckConfig', UptimeCheckConfig::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes an Uptime check configuration. Note that this method will fail - * if the Uptime check configuration is referenced by an alert policy or - * other dependent configs that would be rendered invalid by the deletion. - * - * Sample code: - * ``` - * $uptimeCheckServiceClient = new UptimeCheckServiceClient(); - * try { - * $formattedName = $uptimeCheckServiceClient->uptimeCheckConfigName('[PROJECT]', '[UPTIME_CHECK_CONFIG]'); - * $uptimeCheckServiceClient->deleteUptimeCheckConfig($formattedName); - * } finally { - * $uptimeCheckServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The Uptime check configuration to delete. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID] - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - */ - public function deleteUptimeCheckConfig($name, array $optionalArgs = []) - { - $request = new DeleteUptimeCheckConfigRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteUptimeCheckConfig', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets a single Uptime check configuration. - * - * Sample code: - * ``` - * $uptimeCheckServiceClient = new UptimeCheckServiceClient(); - * try { - * $formattedName = $uptimeCheckServiceClient->uptimeCheckConfigName('[PROJECT]', '[UPTIME_CHECK_CONFIG]'); - * $response = $uptimeCheckServiceClient->getUptimeCheckConfig($formattedName); - * } finally { - * $uptimeCheckServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The Uptime check configuration to retrieve. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID] - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Monitoring\V3\UptimeCheckConfig - * - * @throws ApiException if the remote call fails - */ - public function getUptimeCheckConfig($name, array $optionalArgs = []) - { - $request = new GetUptimeCheckConfigRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetUptimeCheckConfig', UptimeCheckConfig::class, $optionalArgs, $request)->wait(); - } - - /** - * Lists the existing valid Uptime check configurations for the project - * (leaving out any invalid configurations). - * - * Sample code: - * ``` - * $uptimeCheckServiceClient = new UptimeCheckServiceClient(); - * try { - * $parent = 'parent'; - * // Iterate over pages of elements - * $pagedResponse = $uptimeCheckServiceClient->listUptimeCheckConfigs($parent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $uptimeCheckServiceClient->listUptimeCheckConfigs($parent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $uptimeCheckServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) - * whose Uptime check configurations are listed. The format is: - * - * projects/[PROJECT_ID_OR_NUMBER] - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listUptimeCheckConfigs($parent, array $optionalArgs = []) - { - $request = new ListUptimeCheckConfigsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListUptimeCheckConfigs', $optionalArgs, ListUptimeCheckConfigsResponse::class, $request); - } - - /** - * Returns the list of IP addresses that checkers run from - * - * Sample code: - * ``` - * $uptimeCheckServiceClient = new UptimeCheckServiceClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $uptimeCheckServiceClient->listUptimeCheckIps(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $uptimeCheckServiceClient->listUptimeCheckIps(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $uptimeCheckServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listUptimeCheckIps(array $optionalArgs = []) - { - $request = new ListUptimeCheckIpsRequest(); - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - return $this->getPagedListResponse('ListUptimeCheckIps', $optionalArgs, ListUptimeCheckIpsResponse::class, $request); - } - - /** - * Updates an Uptime check configuration. You can either replace the entire - * configuration with a new one or replace only certain fields in the current - * configuration by specifying the fields to be updated via `updateMask`. - * Returns the updated configuration. - * - * Sample code: - * ``` - * $uptimeCheckServiceClient = new UptimeCheckServiceClient(); - * try { - * $uptimeCheckConfig = new UptimeCheckConfig(); - * $response = $uptimeCheckServiceClient->updateUptimeCheckConfig($uptimeCheckConfig); - * } finally { - * $uptimeCheckServiceClient->close(); - * } - * ``` - * - * @param UptimeCheckConfig $uptimeCheckConfig Required. If an `updateMask` has been specified, this field gives - * the values for the set of fields mentioned in the `updateMask`. If an - * `updateMask` has not been given, this Uptime check configuration replaces - * the current configuration. If a field is mentioned in `updateMask` but - * the corresonding field is omitted in this partial Uptime check - * configuration, it has the effect of deleting/clearing the field from the - * configuration on the server. - * - * The following fields can be updated: `display_name`, - * `http_check`, `tcp_check`, `timeout`, `content_matchers`, and - * `selected_regions`. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * Optional. If present, only the listed fields in the current Uptime check - * configuration are updated with values from the new configuration. If this - * field is empty, then the current configuration is completely replaced with - * the new configuration. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Monitoring\V3\UptimeCheckConfig - * - * @throws ApiException if the remote call fails - */ - public function updateUptimeCheckConfig($uptimeCheckConfig, array $optionalArgs = []) - { - $request = new UpdateUptimeCheckConfigRequest(); - $requestParamHeaders = []; - $request->setUptimeCheckConfig($uptimeCheckConfig); - $requestParamHeaders['uptime_check_config.name'] = $uptimeCheckConfig->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateUptimeCheckConfig', UptimeCheckConfig::class, $optionalArgs, $request)->wait(); - } -} diff --git a/owl-bot-staging/Monitoring/v3/src/V3/GroupServiceClient.php b/owl-bot-staging/Monitoring/v3/src/V3/GroupServiceClient.php deleted file mode 100644 index d5c7856e7e8..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/GroupServiceClient.php +++ /dev/null @@ -1,34 +0,0 @@ - [ - 'google.monitoring.v3.AlertPolicyService' => [ - 'ListAlertPolicies' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getAlertPolicies', - ], - ], - ], - ], -]; diff --git a/owl-bot-staging/Monitoring/v3/src/V3/resources/alert_policy_service_rest_client_config.php b/owl-bot-staging/Monitoring/v3/src/V3/resources/alert_policy_service_rest_client_config.php deleted file mode 100644 index 67393699720..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/resources/alert_policy_service_rest_client_config.php +++ /dev/null @@ -1,66 +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', - ], - ], - ], - ], - ], - ], -]; 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 23b49cfcfbc..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/resources/group_service_descriptor_config.php +++ /dev/null @@ -1,28 +0,0 @@ - [ - 'google.monitoring.v3.GroupService' => [ - 'ListGroupMembers' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getMembers', - ], - ], - 'ListGroups' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getGroup', - ], - ], - ], - ], -]; diff --git a/owl-bot-staging/Monitoring/v3/src/V3/resources/group_service_rest_client_config.php b/owl-bot-staging/Monitoring/v3/src/V3/resources/group_service_rest_client_config.php deleted file mode 100644 index 1d828ba8b14..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/resources/group_service_rest_client_config.php +++ /dev/null @@ -1,77 +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', - ], - ], - ], - ], - ], - ], -]; 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 e18d6331cf5..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/resources/metric_service_descriptor_config.php +++ /dev/null @@ -1,38 +0,0 @@ - [ - 'google.monitoring.v3.MetricService' => [ - 'ListMetricDescriptors' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getMetricDescriptors', - ], - ], - 'ListMonitoredResourceDescriptors' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getResourceDescriptors', - ], - ], - 'ListTimeSeries' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getTimeSeries', - ], - ], - ], - ], -]; diff --git a/owl-bot-staging/Monitoring/v3/src/V3/resources/metric_service_rest_client_config.php b/owl-bot-staging/Monitoring/v3/src/V3/resources/metric_service_rest_client_config.php deleted file mode 100644 index c7ed1143106..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/resources/metric_service_rest_client_config.php +++ /dev/null @@ -1,135 +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', - ], - ], - ], - ], -]; 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 022f03a9552..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/resources/notification_channel_service_descriptor_config.php +++ /dev/null @@ -1,28 +0,0 @@ - [ - 'google.monitoring.v3.NotificationChannelService' => [ - 'ListNotificationChannelDescriptors' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getChannelDescriptors', - ], - ], - 'ListNotificationChannels' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getNotificationChannels', - ], - ], - ], - ], -]; diff --git a/owl-bot-staging/Monitoring/v3/src/V3/resources/notification_channel_service_rest_client_config.php b/owl-bot-staging/Monitoring/v3/src/V3/resources/notification_channel_service_rest_client_config.php deleted file mode 100644 index 72d0fce4308..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/resources/notification_channel_service_rest_client_config.php +++ /dev/null @@ -1,124 +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', - ], - ], - ], - ], - ], - ], -]; 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 dec870024e1..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/resources/service_monitoring_service_descriptor_config.php +++ /dev/null @@ -1,28 +0,0 @@ - [ - 'google.monitoring.v3.ServiceMonitoringService' => [ - 'ListServiceLevelObjectives' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getServiceLevelObjectives', - ], - ], - 'ListServices' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getServices', - ], - ], - ], - ], -]; diff --git a/owl-bot-staging/Monitoring/v3/src/V3/resources/service_monitoring_service_rest_client_config.php b/owl-bot-staging/Monitoring/v3/src/V3/resources/service_monitoring_service_rest_client_config.php deleted file mode 100644 index cea286539d5..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/resources/service_monitoring_service_rest_client_config.php +++ /dev/null @@ -1,124 +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', - ], - ], - ], - ], - ], - ], -]; 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 04c912eeb82..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/resources/uptime_check_service_descriptor_config.php +++ /dev/null @@ -1,28 +0,0 @@ - [ - 'google.monitoring.v3.UptimeCheckService' => [ - 'ListUptimeCheckConfigs' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getUptimeCheckConfigs', - ], - ], - 'ListUptimeCheckIps' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getUptimeCheckIps', - ], - ], - ], - ], -]; diff --git a/owl-bot-staging/Monitoring/v3/src/V3/resources/uptime_check_service_rest_client_config.php b/owl-bot-staging/Monitoring/v3/src/V3/resources/uptime_check_service_rest_client_config.php deleted file mode 100644 index 7e11767438d..00000000000 --- a/owl-bot-staging/Monitoring/v3/src/V3/resources/uptime_check_service_rest_client_config.php +++ /dev/null @@ -1,70 +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', - ], - ], - ], - ], - ], - ], -]; 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 a3c03c59780..00000000000 --- a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/AlertPolicyServiceClientTest.php +++ /dev/null @@ -1,408 +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(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $expectedResponse = new AlertPolicy(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $name = 'name3373707'; - $alertPolicy = new AlertPolicy(); - $response = $client->createAlertPolicy($name, $alertPolicy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.AlertPolicyService/CreateAlertPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $actualValue = $actualRequestObject->getAlertPolicy(); - $this->assertProtobufEquals($alertPolicy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function createAlertPolicyExceptionTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $name = 'name3373707'; - $alertPolicy = new AlertPolicy(); - try { - $client->createAlertPolicy($name, $alertPolicy); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function deleteAlertPolicyTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); - $client->deleteAlertPolicy($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.AlertPolicyService/DeleteAlertPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function deleteAlertPolicyExceptionTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); - try { - $client->deleteAlertPolicy($formattedName); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function getAlertPolicyTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $expectedResponse = new AlertPolicy(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); - $response = $client->getAlertPolicy($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.AlertPolicyService/GetAlertPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function getAlertPolicyExceptionTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->alertPolicyName('[PROJECT]', '[ALERT_POLICY]'); - try { - $client->getAlertPolicy($formattedName); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function listAlertPoliciesTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $totalSize = 705419236; - $alertPoliciesElement = new AlertPolicy(); - $alertPolicies = [ - $alertPoliciesElement, - ]; - $expectedResponse = new ListAlertPoliciesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setTotalSize($totalSize); - $expectedResponse->setAlertPolicies($alertPolicies); - $transport->addResponse($expectedResponse); - // Mock request - $name = 'name3373707'; - $response = $client->listAlertPolicies($name); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getAlertPolicies()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.AlertPolicyService/ListAlertPolicies', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function listAlertPoliciesExceptionTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $name = 'name3373707'; - try { - $client->listAlertPolicies($name); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function updateAlertPolicyTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $expectedResponse = new AlertPolicy(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $alertPolicy = new AlertPolicy(); - $response = $client->updateAlertPolicy($alertPolicy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.AlertPolicyService/UpdateAlertPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getAlertPolicy(); - $this->assertProtobufEquals($alertPolicy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function updateAlertPolicyExceptionTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $alertPolicy = new AlertPolicy(); - try { - $client->updateAlertPolicy($alertPolicy); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/GroupServiceClientTest.php b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/GroupServiceClientTest.php deleted file mode 100644 index 6cf6c75915a..00000000000 --- a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/GroupServiceClientTest.php +++ /dev/null @@ -1,500 +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(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $parentName = 'parentName1015022848'; - $filter = 'filter-1274492040'; - $isCluster = false; - $expectedResponse = new Group(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setParentName($parentName); - $expectedResponse->setFilter($filter); - $expectedResponse->setIsCluster($isCluster); - $transport->addResponse($expectedResponse); - // Mock request - $name = 'name3373707'; - $group = new Group(); - $response = $client->createGroup($name, $group); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.GroupService/CreateGroup', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $actualValue = $actualRequestObject->getGroup(); - $this->assertProtobufEquals($group, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function createGroupExceptionTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $name = 'name3373707'; - $group = new Group(); - try { - $client->createGroup($name, $group); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function deleteGroupTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->groupName('[PROJECT]', '[GROUP]'); - $client->deleteGroup($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.GroupService/DeleteGroup', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function deleteGroupExceptionTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->groupName('[PROJECT]', '[GROUP]'); - try { - $client->deleteGroup($formattedName); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function getGroupTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $parentName = 'parentName1015022848'; - $filter = 'filter-1274492040'; - $isCluster = false; - $expectedResponse = new Group(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setParentName($parentName); - $expectedResponse->setFilter($filter); - $expectedResponse->setIsCluster($isCluster); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->groupName('[PROJECT]', '[GROUP]'); - $response = $client->getGroup($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.GroupService/GetGroup', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function getGroupExceptionTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->groupName('[PROJECT]', '[GROUP]'); - try { - $client->getGroup($formattedName); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function listGroupMembersTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $totalSize = 705419236; - $membersElement = new MonitoredResource(); - $members = [ - $membersElement, - ]; - $expectedResponse = new ListGroupMembersResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setTotalSize($totalSize); - $expectedResponse->setMembers($members); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->groupName('[PROJECT]', '[GROUP]'); - $response = $client->listGroupMembers($formattedName); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getMembers()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.GroupService/ListGroupMembers', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function listGroupMembersExceptionTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->groupName('[PROJECT]', '[GROUP]'); - try { - $client->listGroupMembers($formattedName); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function listGroupsTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $groupElement = new Group(); - $group = [ - $groupElement, - ]; - $expectedResponse = new ListGroupsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setGroup($group); - $transport->addResponse($expectedResponse); - // Mock request - $name = 'name3373707'; - $response = $client->listGroups($name); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getGroup()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.GroupService/ListGroups', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function listGroupsExceptionTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $name = 'name3373707'; - try { - $client->listGroups($name); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function updateGroupTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $parentName = 'parentName1015022848'; - $filter = 'filter-1274492040'; - $isCluster = false; - $expectedResponse = new Group(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setParentName($parentName); - $expectedResponse->setFilter($filter); - $expectedResponse->setIsCluster($isCluster); - $transport->addResponse($expectedResponse); - // Mock request - $group = new Group(); - $response = $client->updateGroup($group); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.GroupService/UpdateGroup', $actualFuncCall); - $actualValue = $actualRequestObject->getGroup(); - $this->assertProtobufEquals($group, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function updateGroupExceptionTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $group = new Group(); - try { - $client->updateGroup($group); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/MetricServiceClientTest.php b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/MetricServiceClientTest.php deleted file mode 100644 index d7676aa13fd..00000000000 --- a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/MetricServiceClientTest.php +++ /dev/null @@ -1,716 +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(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $type = 'type3575610'; - $unit = 'unit3594628'; - $description = 'description-1724546052'; - $displayName = 'displayName1615086568'; - $expectedResponse = new MetricDescriptor(); - $expectedResponse->setName($name2); - $expectedResponse->setType($type); - $expectedResponse->setUnit($unit); - $expectedResponse->setDescription($description); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $name = 'name3373707'; - $metricDescriptor = new MetricDescriptor(); - $response = $client->createMetricDescriptor($name, $metricDescriptor); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.MetricService/CreateMetricDescriptor', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $actualValue = $actualRequestObject->getMetricDescriptor(); - $this->assertProtobufEquals($metricDescriptor, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function createMetricDescriptorExceptionTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $name = 'name3373707'; - $metricDescriptor = new MetricDescriptor(); - try { - $client->createMetricDescriptor($name, $metricDescriptor); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function createServiceTimeSeriesTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->projectName('[PROJECT]'); - $timeSeries = []; - $client->createServiceTimeSeries($formattedName, $timeSeries); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.MetricService/CreateServiceTimeSeries', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getTimeSeries(); - $this->assertProtobufEquals($timeSeries, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function createServiceTimeSeriesExceptionTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->projectName('[PROJECT]'); - $timeSeries = []; - try { - $client->createServiceTimeSeries($formattedName, $timeSeries); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function createTimeSeriesTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->projectName('[PROJECT]'); - $timeSeries = []; - $client->createTimeSeries($formattedName, $timeSeries); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.MetricService/CreateTimeSeries', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getTimeSeries(); - $this->assertProtobufEquals($timeSeries, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function createTimeSeriesExceptionTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->projectName('[PROJECT]'); - $timeSeries = []; - try { - $client->createTimeSeries($formattedName, $timeSeries); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function deleteMetricDescriptorTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->metricDescriptorName('[PROJECT]', '[METRIC_DESCRIPTOR]'); - $client->deleteMetricDescriptor($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.MetricService/DeleteMetricDescriptor', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function deleteMetricDescriptorExceptionTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->metricDescriptorName('[PROJECT]', '[METRIC_DESCRIPTOR]'); - try { - $client->deleteMetricDescriptor($formattedName); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function getMetricDescriptorTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $type = 'type3575610'; - $unit = 'unit3594628'; - $description = 'description-1724546052'; - $displayName = 'displayName1615086568'; - $expectedResponse = new MetricDescriptor(); - $expectedResponse->setName($name2); - $expectedResponse->setType($type); - $expectedResponse->setUnit($unit); - $expectedResponse->setDescription($description); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->metricDescriptorName('[PROJECT]', '[METRIC_DESCRIPTOR]'); - $response = $client->getMetricDescriptor($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.MetricService/GetMetricDescriptor', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function getMetricDescriptorExceptionTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->metricDescriptorName('[PROJECT]', '[METRIC_DESCRIPTOR]'); - try { - $client->getMetricDescriptor($formattedName); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function getMonitoredResourceDescriptorTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $type = 'type3575610'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $expectedResponse = new MonitoredResourceDescriptor(); - $expectedResponse->setName($name2); - $expectedResponse->setType($type); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->monitoredResourceDescriptorName('[PROJECT]', '[MONITORED_RESOURCE_DESCRIPTOR]'); - $response = $client->getMonitoredResourceDescriptor($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.MetricService/GetMonitoredResourceDescriptor', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function getMonitoredResourceDescriptorExceptionTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->monitoredResourceDescriptorName('[PROJECT]', '[MONITORED_RESOURCE_DESCRIPTOR]'); - try { - $client->getMonitoredResourceDescriptor($formattedName); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function listMetricDescriptorsTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $metricDescriptorsElement = new MetricDescriptor(); - $metricDescriptors = [ - $metricDescriptorsElement, - ]; - $expectedResponse = new ListMetricDescriptorsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setMetricDescriptors($metricDescriptors); - $transport->addResponse($expectedResponse); - // Mock request - $name = 'name3373707'; - $response = $client->listMetricDescriptors($name); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getMetricDescriptors()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.MetricService/ListMetricDescriptors', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function listMetricDescriptorsExceptionTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $name = 'name3373707'; - try { - $client->listMetricDescriptors($name); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function listMonitoredResourceDescriptorsTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $resourceDescriptorsElement = new MonitoredResourceDescriptor(); - $resourceDescriptors = [ - $resourceDescriptorsElement, - ]; - $expectedResponse = new ListMonitoredResourceDescriptorsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setResourceDescriptors($resourceDescriptors); - $transport->addResponse($expectedResponse); - // Mock request - $name = 'name3373707'; - $response = $client->listMonitoredResourceDescriptors($name); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getResourceDescriptors()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.MetricService/ListMonitoredResourceDescriptors', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function listMonitoredResourceDescriptorsExceptionTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $name = 'name3373707'; - try { - $client->listMonitoredResourceDescriptors($name); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function listTimeSeriesTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $unit = 'unit3594628'; - $timeSeriesElement = new TimeSeries(); - $timeSeries = [ - $timeSeriesElement, - ]; - $expectedResponse = new ListTimeSeriesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setUnit($unit); - $expectedResponse->setTimeSeries($timeSeries); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->workspaceName('[PROJECT]'); - $filter = 'filter-1274492040'; - $interval = new TimeInterval(); - $view = TimeSeriesView::FULL; - $response = $client->listTimeSeries($formattedName, $filter, $interval, $view); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getTimeSeries()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.MetricService/ListTimeSeries', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getFilter(); - $this->assertProtobufEquals($filter, $actualValue); - $actualValue = $actualRequestObject->getInterval(); - $this->assertProtobufEquals($interval, $actualValue); - $actualValue = $actualRequestObject->getView(); - $this->assertProtobufEquals($view, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function listTimeSeriesExceptionTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->workspaceName('[PROJECT]'); - $filter = 'filter-1274492040'; - $interval = new TimeInterval(); - $view = TimeSeriesView::FULL; - try { - $client->listTimeSeries($formattedName, $filter, $interval, $view); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/NotificationChannelServiceClientTest.php b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/NotificationChannelServiceClientTest.php deleted file mode 100644 index d3d56a96975..00000000000 --- a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/NotificationChannelServiceClientTest.php +++ /dev/null @@ -1,764 +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(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $type = 'type3575610'; - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $expectedResponse = new NotificationChannel(); - $expectedResponse->setType($type); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $name = 'name3373707'; - $notificationChannel = new NotificationChannel(); - $response = $client->createNotificationChannel($name, $notificationChannel); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.NotificationChannelService/CreateNotificationChannel', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $actualValue = $actualRequestObject->getNotificationChannel(); - $this->assertProtobufEquals($notificationChannel, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function createNotificationChannelExceptionTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $name = 'name3373707'; - $notificationChannel = new NotificationChannel(); - try { - $client->createNotificationChannel($name, $notificationChannel); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function deleteNotificationChannelTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - $client->deleteNotificationChannel($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.NotificationChannelService/DeleteNotificationChannel', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function deleteNotificationChannelExceptionTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - try { - $client->deleteNotificationChannel($formattedName); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function getNotificationChannelTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $type = 'type3575610'; - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $expectedResponse = new NotificationChannel(); - $expectedResponse->setType($type); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - $response = $client->getNotificationChannel($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.NotificationChannelService/GetNotificationChannel', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function getNotificationChannelExceptionTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - try { - $client->getNotificationChannel($formattedName); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function getNotificationChannelDescriptorTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $type = 'type3575610'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $expectedResponse = new NotificationChannelDescriptor(); - $expectedResponse->setName($name2); - $expectedResponse->setType($type); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->notificationChannelDescriptorName('[PROJECT]', '[CHANNEL_DESCRIPTOR]'); - $response = $client->getNotificationChannelDescriptor($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.NotificationChannelService/GetNotificationChannelDescriptor', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function getNotificationChannelDescriptorExceptionTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->notificationChannelDescriptorName('[PROJECT]', '[CHANNEL_DESCRIPTOR]'); - try { - $client->getNotificationChannelDescriptor($formattedName); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function getNotificationChannelVerificationCodeTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $code = 'code3059181'; - $expectedResponse = new GetNotificationChannelVerificationCodeResponse(); - $expectedResponse->setCode($code); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - $response = $client->getNotificationChannelVerificationCode($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.NotificationChannelService/GetNotificationChannelVerificationCode', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function getNotificationChannelVerificationCodeExceptionTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - try { - $client->getNotificationChannelVerificationCode($formattedName); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function listNotificationChannelDescriptorsTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $channelDescriptorsElement = new NotificationChannelDescriptor(); - $channelDescriptors = [ - $channelDescriptorsElement, - ]; - $expectedResponse = new ListNotificationChannelDescriptorsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setChannelDescriptors($channelDescriptors); - $transport->addResponse($expectedResponse); - // Mock request - $name = 'name3373707'; - $response = $client->listNotificationChannelDescriptors($name); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getChannelDescriptors()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.NotificationChannelService/ListNotificationChannelDescriptors', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function listNotificationChannelDescriptorsExceptionTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $name = 'name3373707'; - try { - $client->listNotificationChannelDescriptors($name); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function listNotificationChannelsTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $totalSize = 705419236; - $notificationChannelsElement = new NotificationChannel(); - $notificationChannels = [ - $notificationChannelsElement, - ]; - $expectedResponse = new ListNotificationChannelsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setTotalSize($totalSize); - $expectedResponse->setNotificationChannels($notificationChannels); - $transport->addResponse($expectedResponse); - // Mock request - $name = 'name3373707'; - $response = $client->listNotificationChannels($name); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getNotificationChannels()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.NotificationChannelService/ListNotificationChannels', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function listNotificationChannelsExceptionTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $name = 'name3373707'; - try { - $client->listNotificationChannels($name); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function sendNotificationChannelVerificationCodeTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - $client->sendNotificationChannelVerificationCode($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.NotificationChannelService/SendNotificationChannelVerificationCode', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function sendNotificationChannelVerificationCodeExceptionTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - try { - $client->sendNotificationChannelVerificationCode($formattedName); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function updateNotificationChannelTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $type = 'type3575610'; - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $expectedResponse = new NotificationChannel(); - $expectedResponse->setType($type); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $notificationChannel = new NotificationChannel(); - $response = $client->updateNotificationChannel($notificationChannel); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.NotificationChannelService/UpdateNotificationChannel', $actualFuncCall); - $actualValue = $actualRequestObject->getNotificationChannel(); - $this->assertProtobufEquals($notificationChannel, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function updateNotificationChannelExceptionTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $notificationChannel = new NotificationChannel(); - try { - $client->updateNotificationChannel($notificationChannel); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function verifyNotificationChannelTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $type = 'type3575610'; - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $description = 'description-1724546052'; - $expectedResponse = new NotificationChannel(); - $expectedResponse->setType($type); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setDescription($description); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - $code = 'code3059181'; - $response = $client->verifyNotificationChannel($formattedName, $code); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.NotificationChannelService/VerifyNotificationChannel', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getCode(); - $this->assertProtobufEquals($code, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function verifyNotificationChannelExceptionTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->notificationChannelName('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - $code = 'code3059181'; - try { - $client->verifyNotificationChannel($formattedName, $code); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/ServiceMonitoringServiceClientTest.php b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/ServiceMonitoringServiceClientTest.php deleted file mode 100644 index 2830db5ad6c..00000000000 --- a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/ServiceMonitoringServiceClientTest.php +++ /dev/null @@ -1,749 +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(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Service(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $parent = 'parent-995424086'; - $service = new Service(); - $response = $client->createService($parent, $service); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.ServiceMonitoringService/CreateService', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($parent, $actualValue); - $actualValue = $actualRequestObject->getService(); - $this->assertProtobufEquals($service, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function createServiceExceptionTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $parent = 'parent-995424086'; - $service = new Service(); - try { - $client->createService($parent, $service); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function createServiceLevelObjectiveTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $goal = 317825.0; - $expectedResponse = new ServiceLevelObjective(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setGoal($goal); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $client->serviceName('[PROJECT]', '[SERVICE]'); - $serviceLevelObjective = new ServiceLevelObjective(); - $response = $client->createServiceLevelObjective($formattedParent, $serviceLevelObjective); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.ServiceMonitoringService/CreateServiceLevelObjective', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getServiceLevelObjective(); - $this->assertProtobufEquals($serviceLevelObjective, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function createServiceLevelObjectiveExceptionTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $client->serviceName('[PROJECT]', '[SERVICE]'); - $serviceLevelObjective = new ServiceLevelObjective(); - try { - $client->createServiceLevelObjective($formattedParent, $serviceLevelObjective); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function deleteServiceTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->serviceName('[PROJECT]', '[SERVICE]'); - $client->deleteService($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.ServiceMonitoringService/DeleteService', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function deleteServiceExceptionTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->serviceName('[PROJECT]', '[SERVICE]'); - try { - $client->deleteService($formattedName); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function deleteServiceLevelObjectiveTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->serviceLevelObjectiveName('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]'); - $client->deleteServiceLevelObjective($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.ServiceMonitoringService/DeleteServiceLevelObjective', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function deleteServiceLevelObjectiveExceptionTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->serviceLevelObjectiveName('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]'); - try { - $client->deleteServiceLevelObjective($formattedName); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function getServiceTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Service(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->serviceName('[PROJECT]', '[SERVICE]'); - $response = $client->getService($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.ServiceMonitoringService/GetService', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function getServiceExceptionTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->serviceName('[PROJECT]', '[SERVICE]'); - try { - $client->getService($formattedName); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function getServiceLevelObjectiveTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $goal = 317825.0; - $expectedResponse = new ServiceLevelObjective(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setGoal($goal); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->serviceLevelObjectiveName('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]'); - $response = $client->getServiceLevelObjective($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.ServiceMonitoringService/GetServiceLevelObjective', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function getServiceLevelObjectiveExceptionTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->serviceLevelObjectiveName('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]'); - try { - $client->getServiceLevelObjective($formattedName); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function listServiceLevelObjectivesTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $serviceLevelObjectivesElement = new ServiceLevelObjective(); - $serviceLevelObjectives = [ - $serviceLevelObjectivesElement, - ]; - $expectedResponse = new ListServiceLevelObjectivesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setServiceLevelObjectives($serviceLevelObjectives); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $client->serviceName('[PROJECT]', '[SERVICE]'); - $response = $client->listServiceLevelObjectives($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getServiceLevelObjectives()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.ServiceMonitoringService/ListServiceLevelObjectives', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function listServiceLevelObjectivesExceptionTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $client->serviceName('[PROJECT]', '[SERVICE]'); - try { - $client->listServiceLevelObjectives($formattedParent); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function listServicesTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $servicesElement = new Service(); - $services = [ - $servicesElement, - ]; - $expectedResponse = new ListServicesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setServices($services); - $transport->addResponse($expectedResponse); - // Mock request - $parent = 'parent-995424086'; - $response = $client->listServices($parent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getServices()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.ServiceMonitoringService/ListServices', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($parent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function listServicesExceptionTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $parent = 'parent-995424086'; - try { - $client->listServices($parent); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function updateServiceTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Service(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $service = new Service(); - $response = $client->updateService($service); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.ServiceMonitoringService/UpdateService', $actualFuncCall); - $actualValue = $actualRequestObject->getService(); - $this->assertProtobufEquals($service, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function updateServiceExceptionTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $service = new Service(); - try { - $client->updateService($service); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function updateServiceLevelObjectiveTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $goal = 317825.0; - $expectedResponse = new ServiceLevelObjective(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setGoal($goal); - $transport->addResponse($expectedResponse); - // Mock request - $serviceLevelObjective = new ServiceLevelObjective(); - $response = $client->updateServiceLevelObjective($serviceLevelObjective); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.ServiceMonitoringService/UpdateServiceLevelObjective', $actualFuncCall); - $actualValue = $actualRequestObject->getServiceLevelObjective(); - $this->assertProtobufEquals($serviceLevelObjective, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function updateServiceLevelObjectiveExceptionTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $serviceLevelObjective = new ServiceLevelObjective(); - try { - $client->updateServiceLevelObjective($serviceLevelObjective); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/UptimeCheckServiceClientTest.php b/owl-bot-staging/Monitoring/v3/tests/Unit/V3/UptimeCheckServiceClientTest.php deleted file mode 100644 index f6b02f0203e..00000000000 --- a/owl-bot-staging/Monitoring/v3/tests/Unit/V3/UptimeCheckServiceClientTest.php +++ /dev/null @@ -1,482 +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(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $isInternal = true; - $expectedResponse = new UptimeCheckConfig(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setIsInternal($isInternal); - $transport->addResponse($expectedResponse); - // Mock request - $parent = 'parent-995424086'; - $uptimeCheckConfig = new UptimeCheckConfig(); - $response = $client->createUptimeCheckConfig($parent, $uptimeCheckConfig); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.UptimeCheckService/CreateUptimeCheckConfig', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($parent, $actualValue); - $actualValue = $actualRequestObject->getUptimeCheckConfig(); - $this->assertProtobufEquals($uptimeCheckConfig, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function createUptimeCheckConfigExceptionTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $parent = 'parent-995424086'; - $uptimeCheckConfig = new UptimeCheckConfig(); - try { - $client->createUptimeCheckConfig($parent, $uptimeCheckConfig); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function deleteUptimeCheckConfigTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->uptimeCheckConfigName('[PROJECT]', '[UPTIME_CHECK_CONFIG]'); - $client->deleteUptimeCheckConfig($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.UptimeCheckService/DeleteUptimeCheckConfig', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function deleteUptimeCheckConfigExceptionTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->uptimeCheckConfigName('[PROJECT]', '[UPTIME_CHECK_CONFIG]'); - try { - $client->deleteUptimeCheckConfig($formattedName); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function getUptimeCheckConfigTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $isInternal = true; - $expectedResponse = new UptimeCheckConfig(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setIsInternal($isInternal); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->uptimeCheckConfigName('[PROJECT]', '[UPTIME_CHECK_CONFIG]'); - $response = $client->getUptimeCheckConfig($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.UptimeCheckService/GetUptimeCheckConfig', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function getUptimeCheckConfigExceptionTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $client->uptimeCheckConfigName('[PROJECT]', '[UPTIME_CHECK_CONFIG]'); - try { - $client->getUptimeCheckConfig($formattedName); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function listUptimeCheckConfigsTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $totalSize = 705419236; - $uptimeCheckConfigsElement = new UptimeCheckConfig(); - $uptimeCheckConfigs = [ - $uptimeCheckConfigsElement, - ]; - $expectedResponse = new ListUptimeCheckConfigsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setTotalSize($totalSize); - $expectedResponse->setUptimeCheckConfigs($uptimeCheckConfigs); - $transport->addResponse($expectedResponse); - // Mock request - $parent = 'parent-995424086'; - $response = $client->listUptimeCheckConfigs($parent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getUptimeCheckConfigs()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.UptimeCheckService/ListUptimeCheckConfigs', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($parent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function listUptimeCheckConfigsExceptionTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $parent = 'parent-995424086'; - try { - $client->listUptimeCheckConfigs($parent); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function listUptimeCheckIpsTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $uptimeCheckIpsElement = new UptimeCheckIp(); - $uptimeCheckIps = [ - $uptimeCheckIpsElement, - ]; - $expectedResponse = new ListUptimeCheckIpsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setUptimeCheckIps($uptimeCheckIps); - $transport->addResponse($expectedResponse); - $response = $client->listUptimeCheckIps(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getUptimeCheckIps()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.UptimeCheckService/ListUptimeCheckIps', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function listUptimeCheckIpsExceptionTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $client->listUptimeCheckIps(); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function updateUptimeCheckConfigTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $isInternal = true; - $expectedResponse = new UptimeCheckConfig(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setIsInternal($isInternal); - $transport->addResponse($expectedResponse); - // Mock request - $uptimeCheckConfig = new UptimeCheckConfig(); - $response = $client->updateUptimeCheckConfig($uptimeCheckConfig); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.monitoring.v3.UptimeCheckService/UpdateUptimeCheckConfig', $actualFuncCall); - $actualValue = $actualRequestObject->getUptimeCheckConfig(); - $this->assertProtobufEquals($uptimeCheckConfig, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function updateUptimeCheckConfigExceptionTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $uptimeCheckConfig = new UptimeCheckConfig(); - try { - $client->updateUptimeCheckConfig($uptimeCheckConfig); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -}