9
9
"net/http"
10
10
"net/url"
11
11
12
+ "github.com/cloudflare/cloudflare-go/v4/internal/apijson"
12
13
"github.com/cloudflare/cloudflare-go/v4/internal/apiquery"
13
14
"github.com/cloudflare/cloudflare-go/v4/internal/param"
14
15
"github.com/cloudflare/cloudflare-go/v4/internal/requestconfig"
@@ -37,6 +38,7 @@ func NewRayIDService(opts ...option.RequestOption) (r *RayIDService) {
37
38
// The `/rayids` api route allows lookups by specific rayid. The rayids route will
38
39
// return zero, one, or more records (ray ids are not unique).
39
40
func (r * RayIDService ) Get (ctx context.Context , RayID string , params RayIDGetParams , opts ... option.RequestOption ) (res * interface {}, err error ) {
41
+ var env apijson.UnionUnmarshaler [interface {}]
40
42
opts = append (r .Options [:], opts ... )
41
43
if params .ZoneID .Value == "" {
42
44
err = errors .New ("missing required zone_id parameter" )
@@ -47,7 +49,11 @@ func (r *RayIDService) Get(ctx context.Context, RayID string, params RayIDGetPar
47
49
return
48
50
}
49
51
path := fmt .Sprintf ("zones/%s/logs/rayids/%s" , params .ZoneID , RayID )
50
- err = requestconfig .ExecuteNewRequest (ctx , http .MethodGet , path , params , & res , opts ... )
52
+ err = requestconfig .ExecuteNewRequest (ctx , http .MethodGet , path , params , & env , opts ... )
53
+ if err != nil {
54
+ return
55
+ }
56
+ res = & env .Value
51
57
return
52
58
}
53
59
0 commit comments