googleapis / google-api-go-client

Auto-generated Google APIs for Go.
https://pkg.go.dev/google.golang.org/api
BSD 3-Clause "New" or "Revised" License
3.9k stars 1.11k forks source link

Ipv4Enabled: false is not works for google.golang.org/api/sqladmin/v1beta4(v1) and ../api/sql/v1beta4 #2625

Closed qspors closed 1 month ago

qspors commented 1 month ago

Original issue: https://github.com/googleapis/google-api-go-client/issues/2620 Bug still exist. Adding unused fields to ForceSendFields is not help.

IPconfiguration struct contain next fields.

settings := sqladmin.DatabaseInstance{
    Settings: &sqladmin.Settings{
        IpConfiguration: &sqladmin.IpConfiguration{
            AllocatedIpRange:                        "",
            AuthorizedNetworks:                      nil,
            EnablePrivatePathForGoogleCloudServices: false,
            Ipv4Enabled:                             false,
            PrivateNetwork:                          "",
            PscConfig:                               nil,
            RequireSsl:                              false,
            SslMode:                                 "",
            ForceSendFields:                         nil,
            NullFields:                              nil,
        }}}

I use Ipv4Enabled and PrivateNetwork. Which fields should be marshalled thru ForceSendFields with default values for pass correct request ? I have tried to use ForceSendFields before for send default values for AllocatedIpRange, AuthorizedNetworks and EnablePrivatePathForGoogleCloudServices but still have same result.

for example:

defFields := []string{"AllocatedIpRange", "AuthorizedNetworks", "EnablePrivatePathForGoogleCloudServices", "RequireSsl", "PscConfig"}
settings := sqladmin.DatabaseInstance{
    Settings: &sqladmin.Settings{
        IpConfiguration: &sqladmin.IpConfiguration{
            Ipv4Enabled:     false,
            PrivateNetwork:  "projects/exampleprj/global/networks/tests-qa-vpc-01",
            ForceSendFields: defFields,
        }}}

Could you give particular set of Fields which working correctly for disable Public IP ?

codyoss commented 1 month ago

Could you give particular set of Fields which working correctly for disable Public IP ?

That I am not sure about and sounds like a question for the service. This issue tracker is primarily focused on just the client library side. I suggest reaching out to the support for that particular API. https://cloud.google.com/sql/docs/mysql/getting-support