{"action":"opened","issue":{"url":"https://api.github.com/repos/googleapis/google-cloud-java/issues/4292","repository_url":"https://api.github.com/repos/googleapis/google-cloud-java","labels_url":"https://api.github.com/repos/googleapis/google-cloud-java/issues/4292/labels{/name}","comments_url":"https://api.github.com/repos/googleapis/google-cloud-java/issues/4292/comments","events_url":"https://api.github.com/repos/googleapis/google-cloud-java/issues/4292/events","html_url":"https://github.com/googleapis/google-cloud-java/issues/4292","id":396102832,"node_id":"MDU6SXNzdWUzOTYxMDI4MzI=","number":4292,"title":"FirewallClient.insertFirewall() generates error despite setting required value. ","user":{"login":"sirhamster","id":19482933,"node_id":"MDQ6VXNlcjE5NDgyOTMz","avatar_url":"https://avatars0.githubusercontent.com/u/19482933?v=4","gravatar_id":"","url":"https://api.github.com/users/sirhamster","html_url":"https://github.com/sirhamster","followers_url":"https://api.github.com/users/sirhamster/followers","following_url":"https://api.github.com/users/sirhamster/following{/other_user}","gists_url":"https://api.github.com/users/sirhamster/gists{/gist_id}","starred_url":"https://api.github.com/users/sirhamster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sirhamster/subscriptions","organizations_url":"https://api.github.com/users/sirhamster/orgs","repos_url":"https://api.github.com/users/sirhamster/repos","events_url":"https://api.github.com/users/sirhamster/events{/privacy}","received_events_url":"https://api.github.com/users/sirhamster/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2019-01-04T23:34:31Z","updated_at":"2019-01-04T23:34:31Z","closed_at":null,"author_association":"NONE","body":"Thanks for stopping by to let us know something could be better!\r\n\r\nPlease include as much information as possible:\r\n\r\n#### Environment details\r\n\r\n- OS: Windows 10\r\n- Java version:  \r\n$ java -version\r\njava version \"1.8.0_191\"\r\nJava(TM) SE Runtime Environment (build 1.8.0_191-b12)\r\nJava HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)\r\n- google-cloud-java version(s):\r\n<artifactId>google-cloud-compute</artifactId>\r\n<version>0.74.0-alpha</version>\r\n\r\n#### Steps to reproduce\r\n\r\n1. See code below.   \r\n\r\n#### Stacktrace\r\n\r\n```\r\nCaused by: com.google.api.client.http.HttpResponseException: 400 Bad Request\r\n{\r\n \"error\": {\r\n  \"errors\": [\r\n   {\r\n    \"domain\": \"global\",\r\n    \"reason\": \"invalid\",\r\n    \"message\": \"Invalid value for field 'resource.allowed[0].IPProtocol': ''. Invalid IP protocol specification.\"\r\n   }\r\n  ],\r\n  \"code\": 400,\r\n  \"message\": \"Invalid value for field 'resource.allowed[0].IPProtocol': ''. Invalid IP protocol specification.\"\r\n }\r\n}\r\n\r\n        at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1070)\r\n        at com.google.api.gax.httpjson.HttpRequestRunnable.run(HttpRequestRunnable.java:130)\r\n        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)\r\n        at java.util.concurrent.FutureTask.run(FutureTask.java:266)\r\n        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)\r\n        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)\r\n        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\r\n        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\r\n        at java.lang.Thread.run(Thread.java:748)\r\n\r\n```\r\n\r\n#### Code snippet\r\n\r\n```java\r\n  String project = \"project/foo\"; \r\n  Allowed allowed = Allowed.newBuilder().setIPProtocol(\"tcp\").addPorts(\"80\").build();\r\n  Firewall firewallResource = Firewall.newBuilder().setName(\"test-rule\").addAllowed(allowed).build();\r\n  firewallClient.insertFirewall(project, firewallResource);\r\n```\r\n\r\n#### External references such as API reference guides used\r\n\r\nhttps://cloud.google.com/compute/docs/reference/rest/v1/firewalls/insert\r\n\r\nFields | Description\r\n------ | ------\r\nallowed[].IPProtocol | string   The IP protocol to which this rule applies. The  protocol type is required when creating a firewall rule. This value can  either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp), or the IP protocol number.\r\n\r\n\r\n#### Any additional information below\r\n\r\nInspecting Allowed.java at https://github.com/googleapis/google-cloud-java/blob/master/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Allowed.java\r\n the fieldname \r\n\r\nline 44:    if (fieldName.equals(\"iPProtocol\")) {\r\n\r\nThe non"}}
{"actor":{"display_login":"sirhamster"}}