IBM / platform-services-go-sdk

Go client library for IBM Cloud Platform Services

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to set depth(int 64) as *

xinxin11 opened this issue · comments

Hi, when I call the GetCatalogEntry and want to set depth and include as *
I could use getCatalogEntryOptions.SetInclude("*") to set the * for include, however I don't know how to set * value for depth which type is int64, could you help?

getCatalogEntryOptions := globalCatalogService.NewGetCatalogEntryOptions(
  catalogEntryID,
)
getCatalogEntryOptions.SetComplete(true)
getCatalogEntryOptions.SetInclude("*")
????
catalogEntry, response, err := globalCatalogService.GetCatalogEntry(getCatalogEntryOptions)

I think the description of the parameter (which comes from the API definition) is more applicable to someone using curl or postman to invoke the operation than for someone using the SDK. The "depth" parameter is defined as an integer, so - as you noticed - you won't be able to set it to the value "*" like you can with the "include" parameter (which is defined as a string). In this situation, I think SDK users simply need to set the "depth" parameter to a large integer in order to include all the depths. You could use maxint or some other value large enough to cover all depths.

@dubee Does this advice seem reasonable? In the Global Catalog API, the get_catalog_entry operation defines "depth" as an integer parameter but yet instructs the user to set it to "*" to get all the depths.