| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
package mybusinessplaceactions |
| 52 |
|
| 53 |
import ( |
| 54 |
"bytes" |
| 55 |
"context" |
| 56 |
"encoding/json" |
| 57 |
"errors" |
| 58 |
"fmt" |
| 59 |
"io" |
| 60 |
"log/slog" |
| 61 |
"net/http" |
| 62 |
"net/url" |
| 63 |
"strconv" |
| 64 |
"strings" |
| 65 |
|
| 66 |
"github.com/googleapis/gax-go/v2/internallog" |
| 67 |
googleapi "google.golang.org/api/googleapi" |
| 68 |
internal "google.golang.org/api/internal" |
| 69 |
gensupport "google.golang.org/api/internal/gensupport" |
| 70 |
option "google.golang.org/api/option" |
| 71 |
internaloption "google.golang.org/api/option/internaloption" |
| 72 |
htransport "google.golang.org/api/transport/http" |
| 73 |
) |
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
var _ = bytes.NewBuffer |
| 78 |
var _ = strconv.Itoa |
| 79 |
var _ = fmt.Sprintf |
| 80 |
var _ = json.NewDecoder |
| 81 |
var _ = io.Copy |
| 82 |
var _ = url.Parse |
| 83 |
var _ = gensupport.MarshalJSON |
| 84 |
var _ = googleapi.Version |
| 85 |
var _ = errors.New |
| 86 |
var _ = strings.Replace |
| 87 |
var _ = context.Canceled |
| 88 |
var _ = internaloption.WithDefaultEndpoint |
| 89 |
var _ = internal.Version |
| 90 |
var _ = internallog.New |
| 91 |
|
| 92 |
const apiId = "mybusinessplaceactions:v1" |
| 93 |
const apiName = "mybusinessplaceactions" |
| 94 |
const apiVersion = "v1" |
| 95 |
const basePath = "https://mybusinessplaceactions.googleapis.com/" |
| 96 |
const basePathTemplate = "https://mybusinessplaceactions.UNIVERSE_DOMAIN/" |
| 97 |
const mtlsBasePath = "https://mybusinessplaceactions.mtls.googleapis.com/" |
| 98 |
|
| 99 |
|
| 100 |
func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { |
| 101 |
opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) |
| 102 |
opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate)) |
| 103 |
opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) |
| 104 |
opts = append(opts, internaloption.EnableNewAuthLibrary()) |
| 105 |
client, endpoint, err := htransport.NewClient(ctx, opts...) |
| 106 |
if err != nil { |
| 107 |
return nil, err |
| 108 |
} |
| 109 |
s := &Service{client: client, BasePath: basePath, logger: internaloption.GetLogger(opts)} |
| 110 |
s.Locations = NewLocationsService(s) |
| 111 |
s.PlaceActionTypeMetadata = NewPlaceActionTypeMetadataService(s) |
| 112 |
if endpoint != "" { |
| 113 |
s.BasePath = endpoint |
| 114 |
} |
| 115 |
return s, nil |
| 116 |
} |
| 117 |
|
| 118 |
|
| 119 |
|
| 120 |
|
| 121 |
|
| 122 |
|
| 123 |
func New(client *http.Client) (*Service, error) { |
| 124 |
if client == nil { |
| 125 |
return nil, errors.New("client is nil") |
| 126 |
} |
| 127 |
return NewService(context.TODO(), option.WithHTTPClient(client)) |
| 128 |
} |
| 129 |
|
| 130 |
type Service struct { |
| 131 |
client *http.Client |
| 132 |
logger *slog.Logger |
| 133 |
BasePath string |
| 134 |
UserAgent string |
| 135 |
|
| 136 |
Locations *LocationsService |
| 137 |
|
| 138 |
PlaceActionTypeMetadata *PlaceActionTypeMetadataService |
| 139 |
} |
| 140 |
|
| 141 |
func (s *Service) userAgent() string { |
| 142 |
if s.UserAgent == "" { |
| 143 |
return googleapi.UserAgent |
| 144 |
} |
| 145 |
return googleapi.UserAgent + " " + s.UserAgent |
| 146 |
} |
| 147 |
|
| 148 |
func NewLocationsService(s *Service) *LocationsService { |
| 149 |
rs := &LocationsService{s: s} |
| 150 |
rs.PlaceActionLinks = NewLocationsPlaceActionLinksService(s) |
| 151 |
return rs |
| 152 |
} |
| 153 |
|
| 154 |
type LocationsService struct { |
| 155 |
s *Service |
| 156 |
|
| 157 |
PlaceActionLinks *LocationsPlaceActionLinksService |
| 158 |
} |
| 159 |
|
| 160 |
func NewLocationsPlaceActionLinksService(s *Service) *LocationsPlaceActionLinksService { |
| 161 |
rs := &LocationsPlaceActionLinksService{s: s} |
| 162 |
return rs |
| 163 |
} |
| 164 |
|
| 165 |
type LocationsPlaceActionLinksService struct { |
| 166 |
s *Service |
| 167 |
} |
| 168 |
|
| 169 |
func NewPlaceActionTypeMetadataService(s *Service) *PlaceActionTypeMetadataService { |
| 170 |
rs := &PlaceActionTypeMetadataService{s: s} |
| 171 |
return rs |
| 172 |
} |
| 173 |
|
| 174 |
type PlaceActionTypeMetadataService struct { |
| 175 |
s *Service |
| 176 |
} |
| 177 |
|
| 178 |
|
| 179 |
|
| 180 |
|
| 181 |
|
| 182 |
type Empty struct { |
| 183 |
|
| 184 |
googleapi.ServerResponse `json:"-"` |
| 185 |
} |
| 186 |
|
| 187 |
|
| 188 |
|
| 189 |
type ListPlaceActionLinksResponse struct { |
| 190 |
|
| 191 |
|
| 192 |
|
| 193 |
NextPageToken string `json:"nextPageToken,omitempty"` |
| 194 |
|
| 195 |
PlaceActionLinks []*PlaceActionLink `json:"placeActionLinks,omitempty"` |
| 196 |
|
| 197 |
|
| 198 |
googleapi.ServerResponse `json:"-"` |
| 199 |
|
| 200 |
|
| 201 |
|
| 202 |
|
| 203 |
|
| 204 |
ForceSendFields []string `json:"-"` |
| 205 |
|
| 206 |
|
| 207 |
|
| 208 |
|
| 209 |
NullFields []string `json:"-"` |
| 210 |
} |
| 211 |
|
| 212 |
func (s ListPlaceActionLinksResponse) MarshalJSON() ([]byte, error) { |
| 213 |
type NoMethod ListPlaceActionLinksResponse |
| 214 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 215 |
} |
| 216 |
|
| 217 |
|
| 218 |
|
| 219 |
type ListPlaceActionTypeMetadataResponse struct { |
| 220 |
|
| 221 |
|
| 222 |
|
| 223 |
|
| 224 |
NextPageToken string `json:"nextPageToken,omitempty"` |
| 225 |
|
| 226 |
|
| 227 |
PlaceActionTypeMetadata []*PlaceActionTypeMetadata `json:"placeActionTypeMetadata,omitempty"` |
| 228 |
|
| 229 |
|
| 230 |
googleapi.ServerResponse `json:"-"` |
| 231 |
|
| 232 |
|
| 233 |
|
| 234 |
|
| 235 |
|
| 236 |
ForceSendFields []string `json:"-"` |
| 237 |
|
| 238 |
|
| 239 |
|
| 240 |
|
| 241 |
NullFields []string `json:"-"` |
| 242 |
} |
| 243 |
|
| 244 |
func (s ListPlaceActionTypeMetadataResponse) MarshalJSON() ([]byte, error) { |
| 245 |
type NoMethod ListPlaceActionTypeMetadataResponse |
| 246 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 247 |
} |
| 248 |
|
| 249 |
|
| 250 |
type PlaceActionLink struct { |
| 251 |
|
| 252 |
CreateTime string `json:"createTime,omitempty"` |
| 253 |
|
| 254 |
|
| 255 |
IsEditable bool `json:"isEditable,omitempty"` |
| 256 |
|
| 257 |
|
| 258 |
|
| 259 |
|
| 260 |
|
| 261 |
IsPreferred bool `json:"isPreferred,omitempty"` |
| 262 |
|
| 263 |
|
| 264 |
|
| 265 |
|
| 266 |
|
| 267 |
|
| 268 |
|
| 269 |
Name string `json:"name,omitempty"` |
| 270 |
|
| 271 |
|
| 272 |
|
| 273 |
|
| 274 |
|
| 275 |
|
| 276 |
|
| 277 |
|
| 278 |
|
| 279 |
|
| 280 |
|
| 281 |
|
| 282 |
|
| 283 |
|
| 284 |
|
| 285 |
|
| 286 |
PlaceActionType string `json:"placeActionType,omitempty"` |
| 287 |
|
| 288 |
|
| 289 |
|
| 290 |
|
| 291 |
|
| 292 |
|
| 293 |
|
| 294 |
|
| 295 |
ProviderType string `json:"providerType,omitempty"` |
| 296 |
|
| 297 |
|
| 298 |
UpdateTime string `json:"updateTime,omitempty"` |
| 299 |
|
| 300 |
|
| 301 |
|
| 302 |
Uri string `json:"uri,omitempty"` |
| 303 |
|
| 304 |
|
| 305 |
googleapi.ServerResponse `json:"-"` |
| 306 |
|
| 307 |
|
| 308 |
|
| 309 |
|
| 310 |
|
| 311 |
ForceSendFields []string `json:"-"` |
| 312 |
|
| 313 |
|
| 314 |
|
| 315 |
|
| 316 |
NullFields []string `json:"-"` |
| 317 |
} |
| 318 |
|
| 319 |
func (s PlaceActionLink) MarshalJSON() ([]byte, error) { |
| 320 |
type NoMethod PlaceActionLink |
| 321 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 322 |
} |
| 323 |
|
| 324 |
|
| 325 |
type PlaceActionTypeMetadata struct { |
| 326 |
|
| 327 |
|
| 328 |
DisplayName string `json:"displayName,omitempty"` |
| 329 |
|
| 330 |
|
| 331 |
|
| 332 |
|
| 333 |
|
| 334 |
|
| 335 |
|
| 336 |
|
| 337 |
|
| 338 |
|
| 339 |
|
| 340 |
|
| 341 |
|
| 342 |
|
| 343 |
|
| 344 |
PlaceActionType string `json:"placeActionType,omitempty"` |
| 345 |
|
| 346 |
|
| 347 |
|
| 348 |
|
| 349 |
|
| 350 |
ForceSendFields []string `json:"-"` |
| 351 |
|
| 352 |
|
| 353 |
|
| 354 |
|
| 355 |
NullFields []string `json:"-"` |
| 356 |
} |
| 357 |
|
| 358 |
func (s PlaceActionTypeMetadata) MarshalJSON() ([]byte, error) { |
| 359 |
type NoMethod PlaceActionTypeMetadata |
| 360 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 361 |
} |
| 362 |
|
| 363 |
type LocationsPlaceActionLinksCreateCall struct { |
| 364 |
s *Service |
| 365 |
parent string |
| 366 |
placeactionlink *PlaceActionLink |
| 367 |
urlParams_ gensupport.URLParams |
| 368 |
ctx_ context.Context |
| 369 |
header_ http.Header |
| 370 |
} |
| 371 |
|
| 372 |
|
| 373 |
|
| 374 |
|
| 375 |
|
| 376 |
|
| 377 |
|
| 378 |
|
| 379 |
func (r *LocationsPlaceActionLinksService) Create(parent string, placeactionlink *PlaceActionLink) *LocationsPlaceActionLinksCreateCall { |
| 380 |
c := &LocationsPlaceActionLinksCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| 381 |
c.parent = parent |
| 382 |
c.placeactionlink = placeactionlink |
| 383 |
return c |
| 384 |
} |
| 385 |
|
| 386 |
|
| 387 |
|
| 388 |
|
| 389 |
func (c *LocationsPlaceActionLinksCreateCall) Fields(s ...googleapi.Field) *LocationsPlaceActionLinksCreateCall { |
| 390 |
c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| 391 |
return c |
| 392 |
} |
| 393 |
|
| 394 |
|
| 395 |
func (c *LocationsPlaceActionLinksCreateCall) Context(ctx context.Context) *LocationsPlaceActionLinksCreateCall { |
| 396 |
c.ctx_ = ctx |
| 397 |
return c |
| 398 |
} |
| 399 |
|
| 400 |
|
| 401 |
|
| 402 |
func (c *LocationsPlaceActionLinksCreateCall) Header() http.Header { |
| 403 |
if c.header_ == nil { |
| 404 |
c.header_ = make(http.Header) |
| 405 |
} |
| 406 |
return c.header_ |
| 407 |
} |
| 408 |
|
| 409 |
func (c *LocationsPlaceActionLinksCreateCall) doRequest(alt string) (*http.Response, error) { |
| 410 |
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) |
| 411 |
body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.placeactionlink) |
| 412 |
if err != nil { |
| 413 |
return nil, err |
| 414 |
} |
| 415 |
c.urlParams_.Set("alt", alt) |
| 416 |
c.urlParams_.Set("prettyPrint", "false") |
| 417 |
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/placeActionLinks") |
| 418 |
urls += "?" + c.urlParams_.Encode() |
| 419 |
req, err := http.NewRequest("POST", urls, body) |
| 420 |
if err != nil { |
| 421 |
return nil, err |
| 422 |
} |
| 423 |
req.Header = reqHeaders |
| 424 |
googleapi.Expand(req.URL, map[string]string{ |
| 425 |
"parent": c.parent, |
| 426 |
}) |
| 427 |
c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "mybusinessplaceactions.locations.placeActionLinks.create", "request", internallog.HTTPRequest(req, body.Bytes())) |
| 428 |
return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| 429 |
} |
| 430 |
|
| 431 |
|
| 432 |
|
| 433 |
|
| 434 |
|
| 435 |
|
| 436 |
|
| 437 |
func (c *LocationsPlaceActionLinksCreateCall) Do(opts ...googleapi.CallOption) (*PlaceActionLink, error) { |
| 438 |
gensupport.SetOptions(c.urlParams_, opts...) |
| 439 |
res, err := c.doRequest("json") |
| 440 |
if res != nil && res.StatusCode == http.StatusNotModified { |
| 441 |
if res.Body != nil { |
| 442 |
res.Body.Close() |
| 443 |
} |
| 444 |
return nil, gensupport.WrapError(&googleapi.Error{ |
| 445 |
Code: res.StatusCode, |
| 446 |
Header: res.Header, |
| 447 |
}) |
| 448 |
} |
| 449 |
if err != nil { |
| 450 |
return nil, err |
| 451 |
} |
| 452 |
defer googleapi.CloseBody(res) |
| 453 |
if err := googleapi.CheckResponse(res); err != nil { |
| 454 |
return nil, gensupport.WrapError(err) |
| 455 |
} |
| 456 |
ret := &PlaceActionLink{ |
| 457 |
ServerResponse: googleapi.ServerResponse{ |
| 458 |
Header: res.Header, |
| 459 |
HTTPStatusCode: res.StatusCode, |
| 460 |
}, |
| 461 |
} |
| 462 |
target := &ret |
| 463 |
b, err := gensupport.DecodeResponseBytes(target, res) |
| 464 |
if err != nil { |
| 465 |
return nil, err |
| 466 |
} |
| 467 |
c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "mybusinessplaceactions.locations.placeActionLinks.create", "response", internallog.HTTPResponse(res, b)) |
| 468 |
return ret, nil |
| 469 |
} |
| 470 |
|
| 471 |
type LocationsPlaceActionLinksDeleteCall struct { |
| 472 |
s *Service |
| 473 |
name string |
| 474 |
urlParams_ gensupport.URLParams |
| 475 |
ctx_ context.Context |
| 476 |
header_ http.Header |
| 477 |
} |
| 478 |
|
| 479 |
|
| 480 |
|
| 481 |
|
| 482 |
|
| 483 |
func (r *LocationsPlaceActionLinksService) Delete(name string) *LocationsPlaceActionLinksDeleteCall { |
| 484 |
c := &LocationsPlaceActionLinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| 485 |
c.name = name |
| 486 |
return c |
| 487 |
} |
| 488 |
|
| 489 |
|
| 490 |
|
| 491 |
|
| 492 |
func (c *LocationsPlaceActionLinksDeleteCall) Fields(s ...googleapi.Field) *LocationsPlaceActionLinksDeleteCall { |
| 493 |
c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| 494 |
return c |
| 495 |
} |
| 496 |
|
| 497 |
|
| 498 |
func (c *LocationsPlaceActionLinksDeleteCall) Context(ctx context.Context) *LocationsPlaceActionLinksDeleteCall { |
| 499 |
c.ctx_ = ctx |
| 500 |
return c |
| 501 |
} |
| 502 |
|
| 503 |
|
| 504 |
|
| 505 |
func (c *LocationsPlaceActionLinksDeleteCall) Header() http.Header { |
| 506 |
if c.header_ == nil { |
| 507 |
c.header_ = make(http.Header) |
| 508 |
} |
| 509 |
return c.header_ |
| 510 |
} |
| 511 |
|
| 512 |
func (c *LocationsPlaceActionLinksDeleteCall) doRequest(alt string) (*http.Response, error) { |
| 513 |
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) |
| 514 |
c.urlParams_.Set("alt", alt) |
| 515 |
c.urlParams_.Set("prettyPrint", "false") |
| 516 |
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") |
| 517 |
urls += "?" + c.urlParams_.Encode() |
| 518 |
req, err := http.NewRequest("DELETE", urls, nil) |
| 519 |
if err != nil { |
| 520 |
return nil, err |
| 521 |
} |
| 522 |
req.Header = reqHeaders |
| 523 |
googleapi.Expand(req.URL, map[string]string{ |
| 524 |
"name": c.name, |
| 525 |
}) |
| 526 |
c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "mybusinessplaceactions.locations.placeActionLinks.delete", "request", internallog.HTTPRequest(req, nil)) |
| 527 |
return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| 528 |
} |
| 529 |
|
| 530 |
|
| 531 |
|
| 532 |
|
| 533 |
|
| 534 |
|
| 535 |
func (c *LocationsPlaceActionLinksDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { |
| 536 |
gensupport.SetOptions(c.urlParams_, opts...) |
| 537 |
res, err := c.doRequest("json") |
| 538 |
if res != nil && res.StatusCode == http.StatusNotModified { |
| 539 |
if res.Body != nil { |
| 540 |
res.Body.Close() |
| 541 |
} |
| 542 |
return nil, gensupport.WrapError(&googleapi.Error{ |
| 543 |
Code: res.StatusCode, |
| 544 |
Header: res.Header, |
| 545 |
}) |
| 546 |
} |
| 547 |
if err != nil { |
| 548 |
return nil, err |
| 549 |
} |
| 550 |
defer googleapi.CloseBody(res) |
| 551 |
if err := googleapi.CheckResponse(res); err != nil { |
| 552 |
return nil, gensupport.WrapError(err) |
| 553 |
} |
| 554 |
ret := &Empty{ |
| 555 |
ServerResponse: googleapi.ServerResponse{ |
| 556 |
Header: res.Header, |
| 557 |
HTTPStatusCode: res.StatusCode, |
| 558 |
}, |
| 559 |
} |
| 560 |
target := &ret |
| 561 |
b, err := gensupport.DecodeResponseBytes(target, res) |
| 562 |
if err != nil { |
| 563 |
return nil, err |
| 564 |
} |
| 565 |
c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "mybusinessplaceactions.locations.placeActionLinks.delete", "response", internallog.HTTPResponse(res, b)) |
| 566 |
return ret, nil |
| 567 |
} |
| 568 |
|
| 569 |
type LocationsPlaceActionLinksGetCall struct { |
| 570 |
s *Service |
| 571 |
name string |
| 572 |
urlParams_ gensupport.URLParams |
| 573 |
ifNoneMatch_ string |
| 574 |
ctx_ context.Context |
| 575 |
header_ http.Header |
| 576 |
} |
| 577 |
|
| 578 |
|
| 579 |
|
| 580 |
|
| 581 |
func (r *LocationsPlaceActionLinksService) Get(name string) *LocationsPlaceActionLinksGetCall { |
| 582 |
c := &LocationsPlaceActionLinksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| 583 |
c.name = name |
| 584 |
return c |
| 585 |
} |
| 586 |
|
| 587 |
|
| 588 |
|
| 589 |
|
| 590 |
func (c *LocationsPlaceActionLinksGetCall) Fields(s ...googleapi.Field) *LocationsPlaceActionLinksGetCall { |
| 591 |
c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| 592 |
return c |
| 593 |
} |
| 594 |
|
| 595 |
|
| 596 |
|
| 597 |
|
| 598 |
func (c *LocationsPlaceActionLinksGetCall) IfNoneMatch(entityTag string) *LocationsPlaceActionLinksGetCall { |
| 599 |
c.ifNoneMatch_ = entityTag |
| 600 |
return c |
| 601 |
} |
| 602 |
|
| 603 |
|
| 604 |
func (c *LocationsPlaceActionLinksGetCall) Context(ctx context.Context) *LocationsPlaceActionLinksGetCall { |
| 605 |
c.ctx_ = ctx |
| 606 |
return c |
| 607 |
} |
| 608 |
|
| 609 |
|
| 610 |
|
| 611 |
func (c *LocationsPlaceActionLinksGetCall) Header() http.Header { |
| 612 |
if c.header_ == nil { |
| 613 |
c.header_ = make(http.Header) |
| 614 |
} |
| 615 |
return c.header_ |
| 616 |
} |
| 617 |
|
| 618 |
func (c *LocationsPlaceActionLinksGetCall) doRequest(alt string) (*http.Response, error) { |
| 619 |
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) |
| 620 |
if c.ifNoneMatch_ != "" { |
| 621 |
reqHeaders.Set("If-None-Match", c.ifNoneMatch_) |
| 622 |
} |
| 623 |
c.urlParams_.Set("alt", alt) |
| 624 |
c.urlParams_.Set("prettyPrint", "false") |
| 625 |
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") |
| 626 |
urls += "?" + c.urlParams_.Encode() |
| 627 |
req, err := http.NewRequest("GET", urls, nil) |
| 628 |
if err != nil { |
| 629 |
return nil, err |
| 630 |
} |
| 631 |
req.Header = reqHeaders |
| 632 |
googleapi.Expand(req.URL, map[string]string{ |
| 633 |
"name": c.name, |
| 634 |
}) |
| 635 |
c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "mybusinessplaceactions.locations.placeActionLinks.get", "request", internallog.HTTPRequest(req, nil)) |
| 636 |
return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| 637 |
} |
| 638 |
|
| 639 |
|
| 640 |
|
| 641 |
|
| 642 |
|
| 643 |
|
| 644 |
|
| 645 |
func (c *LocationsPlaceActionLinksGetCall) Do(opts ...googleapi.CallOption) (*PlaceActionLink, error) { |
| 646 |
gensupport.SetOptions(c.urlParams_, opts...) |
| 647 |
res, err := c.doRequest("json") |
| 648 |
if res != nil && res.StatusCode == http.StatusNotModified { |
| 649 |
if res.Body != nil { |
| 650 |
res.Body.Close() |
| 651 |
} |
| 652 |
return nil, gensupport.WrapError(&googleapi.Error{ |
| 653 |
Code: res.StatusCode, |
| 654 |
Header: res.Header, |
| 655 |
}) |
| 656 |
} |
| 657 |
if err != nil { |
| 658 |
return nil, err |
| 659 |
} |
| 660 |
defer googleapi.CloseBody(res) |
| 661 |
if err := googleapi.CheckResponse(res); err != nil { |
| 662 |
return nil, gensupport.WrapError(err) |
| 663 |
} |
| 664 |
ret := &PlaceActionLink{ |
| 665 |
ServerResponse: googleapi.ServerResponse{ |
| 666 |
Header: res.Header, |
| 667 |
HTTPStatusCode: res.StatusCode, |
| 668 |
}, |
| 669 |
} |
| 670 |
target := &ret |
| 671 |
b, err := gensupport.DecodeResponseBytes(target, res) |
| 672 |
if err != nil { |
| 673 |
return nil, err |
| 674 |
} |
| 675 |
c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "mybusinessplaceactions.locations.placeActionLinks.get", "response", internallog.HTTPResponse(res, b)) |
| 676 |
return ret, nil |
| 677 |
} |
| 678 |
|
| 679 |
type LocationsPlaceActionLinksListCall struct { |
| 680 |
s *Service |
| 681 |
parent string |
| 682 |
urlParams_ gensupport.URLParams |
| 683 |
ifNoneMatch_ string |
| 684 |
ctx_ context.Context |
| 685 |
header_ http.Header |
| 686 |
} |
| 687 |
|
| 688 |
|
| 689 |
|
| 690 |
|
| 691 |
|
| 692 |
func (r *LocationsPlaceActionLinksService) List(parent string) *LocationsPlaceActionLinksListCall { |
| 693 |
c := &LocationsPlaceActionLinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| 694 |
c.parent = parent |
| 695 |
return c |
| 696 |
} |
| 697 |
|
| 698 |
|
| 699 |
|
| 700 |
|
| 701 |
|
| 702 |
func (c *LocationsPlaceActionLinksListCall) Filter(filter string) *LocationsPlaceActionLinksListCall { |
| 703 |
c.urlParams_.Set("filter", filter) |
| 704 |
return c |
| 705 |
} |
| 706 |
|
| 707 |
|
| 708 |
|
| 709 |
func (c *LocationsPlaceActionLinksListCall) PageSize(pageSize int64) *LocationsPlaceActionLinksListCall { |
| 710 |
c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) |
| 711 |
return c |
| 712 |
} |
| 713 |
|
| 714 |
|
| 715 |
|
| 716 |
func (c *LocationsPlaceActionLinksListCall) PageToken(pageToken string) *LocationsPlaceActionLinksListCall { |
| 717 |
c.urlParams_.Set("pageToken", pageToken) |
| 718 |
return c |
| 719 |
} |
| 720 |
|
| 721 |
|
| 722 |
|
| 723 |
|
| 724 |
func (c *LocationsPlaceActionLinksListCall) Fields(s ...googleapi.Field) *LocationsPlaceActionLinksListCall { |
| 725 |
c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| 726 |
return c |
| 727 |
} |
| 728 |
|
| 729 |
|
| 730 |
|
| 731 |
|
| 732 |
func (c *LocationsPlaceActionLinksListCall) IfNoneMatch(entityTag string) *LocationsPlaceActionLinksListCall { |
| 733 |
c.ifNoneMatch_ = entityTag |
| 734 |
return c |
| 735 |
} |
| 736 |
|
| 737 |
|
| 738 |
func (c *LocationsPlaceActionLinksListCall) Context(ctx context.Context) *LocationsPlaceActionLinksListCall { |
| 739 |
c.ctx_ = ctx |
| 740 |
return c |
| 741 |
} |
| 742 |
|
| 743 |
|
| 744 |
|
| 745 |
func (c *LocationsPlaceActionLinksListCall) Header() http.Header { |
| 746 |
if c.header_ == nil { |
| 747 |
c.header_ = make(http.Header) |
| 748 |
} |
| 749 |
return c.header_ |
| 750 |
} |
| 751 |
|
| 752 |
func (c *LocationsPlaceActionLinksListCall) doRequest(alt string) (*http.Response, error) { |
| 753 |
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) |
| 754 |
if c.ifNoneMatch_ != "" { |
| 755 |
reqHeaders.Set("If-None-Match", c.ifNoneMatch_) |
| 756 |
} |
| 757 |
c.urlParams_.Set("alt", alt) |
| 758 |
c.urlParams_.Set("prettyPrint", "false") |
| 759 |
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/placeActionLinks") |
| 760 |
urls += "?" + c.urlParams_.Encode() |
| 761 |
req, err := http.NewRequest("GET", urls, nil) |
| 762 |
if err != nil { |
| 763 |
return nil, err |
| 764 |
} |
| 765 |
req.Header = reqHeaders |
| 766 |
googleapi.Expand(req.URL, map[string]string{ |
| 767 |
"parent": c.parent, |
| 768 |
}) |
| 769 |
c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "mybusinessplaceactions.locations.placeActionLinks.list", "request", internallog.HTTPRequest(req, nil)) |
| 770 |
return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| 771 |
} |
| 772 |
|
| 773 |
|
| 774 |
|
| 775 |
|
| 776 |
|
| 777 |
|
| 778 |
|
| 779 |
func (c *LocationsPlaceActionLinksListCall) Do(opts ...googleapi.CallOption) (*ListPlaceActionLinksResponse, error) { |
| 780 |
gensupport.SetOptions(c.urlParams_, opts...) |
| 781 |
res, err := c.doRequest("json") |
| 782 |
if res != nil && res.StatusCode == http.StatusNotModified { |
| 783 |
if res.Body != nil { |
| 784 |
res.Body.Close() |
| 785 |
} |
| 786 |
return nil, gensupport.WrapError(&googleapi.Error{ |
| 787 |
Code: res.StatusCode, |
| 788 |
Header: res.Header, |
| 789 |
}) |
| 790 |
} |
| 791 |
if err != nil { |
| 792 |
return nil, err |
| 793 |
} |
| 794 |
defer googleapi.CloseBody(res) |
| 795 |
if err := googleapi.CheckResponse(res); err != nil { |
| 796 |
return nil, gensupport.WrapError(err) |
| 797 |
} |
| 798 |
ret := &ListPlaceActionLinksResponse{ |
| 799 |
ServerResponse: googleapi.ServerResponse{ |
| 800 |
Header: res.Header, |
| 801 |
HTTPStatusCode: res.StatusCode, |
| 802 |
}, |
| 803 |
} |
| 804 |
target := &ret |
| 805 |
b, err := gensupport.DecodeResponseBytes(target, res) |
| 806 |
if err != nil { |
| 807 |
return nil, err |
| 808 |
} |
| 809 |
c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "mybusinessplaceactions.locations.placeActionLinks.list", "response", internallog.HTTPResponse(res, b)) |
| 810 |
return ret, nil |
| 811 |
} |
| 812 |
|
| 813 |
|
| 814 |
|
| 815 |
|
| 816 |
func (c *LocationsPlaceActionLinksListCall) Pages(ctx context.Context, f func(*ListPlaceActionLinksResponse) error) error { |
| 817 |
c.ctx_ = ctx |
| 818 |
defer c.PageToken(c.urlParams_.Get("pageToken")) |
| 819 |
for { |
| 820 |
x, err := c.Do() |
| 821 |
if err != nil { |
| 822 |
return err |
| 823 |
} |
| 824 |
if err := f(x); err != nil { |
| 825 |
return err |
| 826 |
} |
| 827 |
if x.NextPageToken == "" { |
| 828 |
return nil |
| 829 |
} |
| 830 |
c.PageToken(x.NextPageToken) |
| 831 |
} |
| 832 |
} |
| 833 |
|
| 834 |
type LocationsPlaceActionLinksPatchCall struct { |
| 835 |
s *Service |
| 836 |
name string |
| 837 |
placeactionlink *PlaceActionLink |
| 838 |
urlParams_ gensupport.URLParams |
| 839 |
ctx_ context.Context |
| 840 |
header_ http.Header |
| 841 |
} |
| 842 |
|
| 843 |
|
| 844 |
|
| 845 |
|
| 846 |
|
| 847 |
|
| 848 |
|
| 849 |
|
| 850 |
|
| 851 |
|
| 852 |
func (r *LocationsPlaceActionLinksService) Patch(name string, placeactionlink *PlaceActionLink) *LocationsPlaceActionLinksPatchCall { |
| 853 |
c := &LocationsPlaceActionLinksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| 854 |
c.name = name |
| 855 |
c.placeactionlink = placeactionlink |
| 856 |
return c |
| 857 |
} |
| 858 |
|
| 859 |
|
| 860 |
|
| 861 |
|
| 862 |
|
| 863 |
|
| 864 |
func (c *LocationsPlaceActionLinksPatchCall) UpdateMask(updateMask string) *LocationsPlaceActionLinksPatchCall { |
| 865 |
c.urlParams_.Set("updateMask", updateMask) |
| 866 |
return c |
| 867 |
} |
| 868 |
|
| 869 |
|
| 870 |
|
| 871 |
|
| 872 |
func (c *LocationsPlaceActionLinksPatchCall) Fields(s ...googleapi.Field) *LocationsPlaceActionLinksPatchCall { |
| 873 |
c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| 874 |
return c |
| 875 |
} |
| 876 |
|
| 877 |
|
| 878 |
func (c *LocationsPlaceActionLinksPatchCall) Context(ctx context.Context) *LocationsPlaceActionLinksPatchCall { |
| 879 |
c.ctx_ = ctx |
| 880 |
return c |
| 881 |
} |
| 882 |
|
| 883 |
|
| 884 |
|
| 885 |
func (c *LocationsPlaceActionLinksPatchCall) Header() http.Header { |
| 886 |
if c.header_ == nil { |
| 887 |
c.header_ = make(http.Header) |
| 888 |
} |
| 889 |
return c.header_ |
| 890 |
} |
| 891 |
|
| 892 |
func (c *LocationsPlaceActionLinksPatchCall) doRequest(alt string) (*http.Response, error) { |
| 893 |
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) |
| 894 |
body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.placeactionlink) |
| 895 |
if err != nil { |
| 896 |
return nil, err |
| 897 |
} |
| 898 |
c.urlParams_.Set("alt", alt) |
| 899 |
c.urlParams_.Set("prettyPrint", "false") |
| 900 |
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") |
| 901 |
urls += "?" + c.urlParams_.Encode() |
| 902 |
req, err := http.NewRequest("PATCH", urls, body) |
| 903 |
if err != nil { |
| 904 |
return nil, err |
| 905 |
} |
| 906 |
req.Header = reqHeaders |
| 907 |
googleapi.Expand(req.URL, map[string]string{ |
| 908 |
"name": c.name, |
| 909 |
}) |
| 910 |
c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "mybusinessplaceactions.locations.placeActionLinks.patch", "request", internallog.HTTPRequest(req, body.Bytes())) |
| 911 |
return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| 912 |
} |
| 913 |
|
| 914 |
|
| 915 |
|
| 916 |
|
| 917 |
|
| 918 |
|
| 919 |
|
| 920 |
func (c *LocationsPlaceActionLinksPatchCall) Do(opts ...googleapi.CallOption) (*PlaceActionLink, error) { |
| 921 |
gensupport.SetOptions(c.urlParams_, opts...) |
| 922 |
res, err := c.doRequest("json") |
| 923 |
if res != nil && res.StatusCode == http.StatusNotModified { |
| 924 |
if res.Body != nil { |
| 925 |
res.Body.Close() |
| 926 |
} |
| 927 |
return nil, gensupport.WrapError(&googleapi.Error{ |
| 928 |
Code: res.StatusCode, |
| 929 |
Header: res.Header, |
| 930 |
}) |
| 931 |
} |
| 932 |
if err != nil { |
| 933 |
return nil, err |
| 934 |
} |
| 935 |
defer googleapi.CloseBody(res) |
| 936 |
if err := googleapi.CheckResponse(res); err != nil { |
| 937 |
return nil, gensupport.WrapError(err) |
| 938 |
} |
| 939 |
ret := &PlaceActionLink{ |
| 940 |
ServerResponse: googleapi.ServerResponse{ |
| 941 |
Header: res.Header, |
| 942 |
HTTPStatusCode: res.StatusCode, |
| 943 |
}, |
| 944 |
} |
| 945 |
target := &ret |
| 946 |
b, err := gensupport.DecodeResponseBytes(target, res) |
| 947 |
if err != nil { |
| 948 |
return nil, err |
| 949 |
} |
| 950 |
c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "mybusinessplaceactions.locations.placeActionLinks.patch", "response", internallog.HTTPResponse(res, b)) |
| 951 |
return ret, nil |
| 952 |
} |
| 953 |
|
| 954 |
type PlaceActionTypeMetadataListCall struct { |
| 955 |
s *Service |
| 956 |
urlParams_ gensupport.URLParams |
| 957 |
ifNoneMatch_ string |
| 958 |
ctx_ context.Context |
| 959 |
header_ http.Header |
| 960 |
} |
| 961 |
|
| 962 |
|
| 963 |
|
| 964 |
func (r *PlaceActionTypeMetadataService) List() *PlaceActionTypeMetadataListCall { |
| 965 |
c := &PlaceActionTypeMetadataListCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| 966 |
return c |
| 967 |
} |
| 968 |
|
| 969 |
|
| 970 |
|
| 971 |
|
| 972 |
|
| 973 |
|
| 974 |
|
| 975 |
|
| 976 |
func (c *PlaceActionTypeMetadataListCall) Filter(filter string) *PlaceActionTypeMetadataListCall { |
| 977 |
c.urlParams_.Set("filter", filter) |
| 978 |
return c |
| 979 |
} |
| 980 |
|
| 981 |
|
| 982 |
|
| 983 |
|
| 984 |
func (c *PlaceActionTypeMetadataListCall) LanguageCode(languageCode string) *PlaceActionTypeMetadataListCall { |
| 985 |
c.urlParams_.Set("languageCode", languageCode) |
| 986 |
return c |
| 987 |
} |
| 988 |
|
| 989 |
|
| 990 |
|
| 991 |
func (c *PlaceActionTypeMetadataListCall) PageSize(pageSize int64) *PlaceActionTypeMetadataListCall { |
| 992 |
c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) |
| 993 |
return c |
| 994 |
} |
| 995 |
|
| 996 |
|
| 997 |
|
| 998 |
|
| 999 |
|
| 1000 |
func (c *PlaceActionTypeMetadataListCall) PageToken(pageToken string) *PlaceActionTypeMetadataListCall { |
| 1001 |
c.urlParams_.Set("pageToken", pageToken) |
| 1002 |
return c |
| 1003 |
} |
| 1004 |
|
| 1005 |
|
| 1006 |
|
| 1007 |
|
| 1008 |
func (c *PlaceActionTypeMetadataListCall) Fields(s ...googleapi.Field) *PlaceActionTypeMetadataListCall { |
| 1009 |
c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| 1010 |
return c |
| 1011 |
} |
| 1012 |
|
| 1013 |
|
| 1014 |
|
| 1015 |
|
| 1016 |
func (c *PlaceActionTypeMetadataListCall) IfNoneMatch(entityTag string) *PlaceActionTypeMetadataListCall { |
| 1017 |
c.ifNoneMatch_ = entityTag |
| 1018 |
return c |
| 1019 |
} |
| 1020 |
|
| 1021 |
|
| 1022 |
func (c *PlaceActionTypeMetadataListCall) Context(ctx context.Context) *PlaceActionTypeMetadataListCall { |
| 1023 |
c.ctx_ = ctx |
| 1024 |
return c |
| 1025 |
} |
| 1026 |
|
| 1027 |
|
| 1028 |
|
| 1029 |
func (c *PlaceActionTypeMetadataListCall) Header() http.Header { |
| 1030 |
if c.header_ == nil { |
| 1031 |
c.header_ = make(http.Header) |
| 1032 |
} |
| 1033 |
return c.header_ |
| 1034 |
} |
| 1035 |
|
| 1036 |
func (c *PlaceActionTypeMetadataListCall) doRequest(alt string) (*http.Response, error) { |
| 1037 |
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) |
| 1038 |
if c.ifNoneMatch_ != "" { |
| 1039 |
reqHeaders.Set("If-None-Match", c.ifNoneMatch_) |
| 1040 |
} |
| 1041 |
c.urlParams_.Set("alt", alt) |
| 1042 |
c.urlParams_.Set("prettyPrint", "false") |
| 1043 |
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/placeActionTypeMetadata") |
| 1044 |
urls += "?" + c.urlParams_.Encode() |
| 1045 |
req, err := http.NewRequest("GET", urls, nil) |
| 1046 |
if err != nil { |
| 1047 |
return nil, err |
| 1048 |
} |
| 1049 |
req.Header = reqHeaders |
| 1050 |
c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "mybusinessplaceactions.placeActionTypeMetadata.list", "request", internallog.HTTPRequest(req, nil)) |
| 1051 |
return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| 1052 |
} |
| 1053 |
|
| 1054 |
|
| 1055 |
|
| 1056 |
|
| 1057 |
|
| 1058 |
|
| 1059 |
|
| 1060 |
func (c *PlaceActionTypeMetadataListCall) Do(opts ...googleapi.CallOption) (*ListPlaceActionTypeMetadataResponse, error) { |
| 1061 |
gensupport.SetOptions(c.urlParams_, opts...) |
| 1062 |
res, err := c.doRequest("json") |
| 1063 |
if res != nil && res.StatusCode == http.StatusNotModified { |
| 1064 |
if res.Body != nil { |
| 1065 |
res.Body.Close() |
| 1066 |
} |
| 1067 |
return nil, gensupport.WrapError(&googleapi.Error{ |
| 1068 |
Code: res.StatusCode, |
| 1069 |
Header: res.Header, |
| 1070 |
}) |
| 1071 |
} |
| 1072 |
if err != nil { |
| 1073 |
return nil, err |
| 1074 |
} |
| 1075 |
defer googleapi.CloseBody(res) |
| 1076 |
if err := googleapi.CheckResponse(res); err != nil { |
| 1077 |
return nil, gensupport.WrapError(err) |
| 1078 |
} |
| 1079 |
ret := &ListPlaceActionTypeMetadataResponse{ |
| 1080 |
ServerResponse: googleapi.ServerResponse{ |
| 1081 |
Header: res.Header, |
| 1082 |
HTTPStatusCode: res.StatusCode, |
| 1083 |
}, |
| 1084 |
} |
| 1085 |
target := &ret |
| 1086 |
b, err := gensupport.DecodeResponseBytes(target, res) |
| 1087 |
if err != nil { |
| 1088 |
return nil, err |
| 1089 |
} |
| 1090 |
c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "mybusinessplaceactions.placeActionTypeMetadata.list", "response", internallog.HTTPResponse(res, b)) |
| 1091 |
return ret, nil |
| 1092 |
} |
| 1093 |
|
| 1094 |
|
| 1095 |
|
| 1096 |
|
| 1097 |
func (c *PlaceActionTypeMetadataListCall) Pages(ctx context.Context, f func(*ListPlaceActionTypeMetadataResponse) error) error { |
| 1098 |
c.ctx_ = ctx |
| 1099 |
defer c.PageToken(c.urlParams_.Get("pageToken")) |
| 1100 |
for { |
| 1101 |
x, err := c.Do() |
| 1102 |
if err != nil { |
| 1103 |
return err |
| 1104 |
} |
| 1105 |
if err := f(x); err != nil { |
| 1106 |
return err |
| 1107 |
} |
| 1108 |
if x.NextPageToken == "" { |
| 1109 |
return nil |
| 1110 |
} |
| 1111 |
c.PageToken(x.NextPageToken) |
| 1112 |
} |
| 1113 |
} |