production_plan_urlbuilder.go 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. // Code generated by go-swagger; DO NOT EDIT.
  2. package operations
  3. // This file was generated by the swagger tool.
  4. // Editing this file might prove futile when you re-run the generate command
  5. import (
  6. "errors"
  7. "net/url"
  8. golangswaggerpaths "path"
  9. )
  10. // ProductionPlanURL generates an URL for the production plan operation
  11. type ProductionPlanURL struct {
  12. _basePath string
  13. }
  14. // WithBasePath sets the base path for this url builder, only required when it's different from the
  15. // base path specified in the swagger spec.
  16. // When the value of the base path is an empty string
  17. func (o *ProductionPlanURL) WithBasePath(bp string) *ProductionPlanURL {
  18. o.SetBasePath(bp)
  19. return o
  20. }
  21. // SetBasePath sets the base path for this url builder, only required when it's different from the
  22. // base path specified in the swagger spec.
  23. // When the value of the base path is an empty string
  24. func (o *ProductionPlanURL) SetBasePath(bp string) {
  25. o._basePath = bp
  26. }
  27. // Build a url path and query string
  28. func (o *ProductionPlanURL) Build() (*url.URL, error) {
  29. var _result url.URL
  30. var _path = "/productionplan"
  31. _basePath := o._basePath
  32. _result.Path = golangswaggerpaths.Join(_basePath, _path)
  33. return &_result, nil
  34. }
  35. // Must is a helper function to panic when the url builder returns an error
  36. func (o *ProductionPlanURL) Must(u *url.URL, err error) *url.URL {
  37. if err != nil {
  38. panic(err)
  39. }
  40. if u == nil {
  41. panic("url can't be nil")
  42. }
  43. return u
  44. }
  45. // String returns the string representation of the path with query string
  46. func (o *ProductionPlanURL) String() string {
  47. return o.Must(o.Build()).String()
  48. }
  49. // BuildFull builds a full url with scheme, host, path and query string
  50. func (o *ProductionPlanURL) BuildFull(scheme, host string) (*url.URL, error) {
  51. if scheme == "" {
  52. return nil, errors.New("scheme is required for a full url on ProductionPlanURL")
  53. }
  54. if host == "" {
  55. return nil, errors.New("host is required for a full url on ProductionPlanURL")
  56. }
  57. base, err := o.Build()
  58. if err != nil {
  59. return nil, err
  60. }
  61. base.Scheme = scheme
  62. base.Host = host
  63. return base, nil
  64. }
  65. // StringFull returns the string representation of a complete url
  66. func (o *ProductionPlanURL) StringFull(scheme, host string) string {
  67. return o.Must(o.BuildFull(scheme, host)).String()
  68. }