@@ -6,11 +6,12 @@ import (
66 "fmt"
77)
88
9- func (c * PortClient ) ReadEntity (ctx context.Context , id string ) (* Entity , error ) {
10- url := "v0.1 /entities/{identifier}"
9+ func (c * PortClient ) ReadEntity (ctx context.Context , id string , blueprint string ) (* Entity , error ) {
10+ url := "v1/blueprints/{blueprint} /entities/{identifier}"
1111 resp , err := c .Client .R ().
1212 SetHeader ("Accept" , "application/json" ).
13- SetQueryParam ("exclude_mirror_properties" , "true" ).
13+ SetQueryParam ("exclude_calculated_properties" , "true" ).
14+ SetPathParam (("blueprint" ), blueprint ).
1415 SetPathParam ("identifier" , id ).
1516 Get (url )
1617 if err != nil {
@@ -25,10 +26,11 @@ func (c *PortClient) ReadEntity(ctx context.Context, id string) (*Entity, error)
2526}
2627
2728func (c * PortClient ) CreateEntity (ctx context.Context , e * Entity ) (* Entity , error ) {
28- url := "v0.1 /entities"
29+ url := "v1/blueprints/{blueprint} /entities"
2930 pb := & PortBody {}
3031 resp , err := c .Client .R ().
3132 SetBody (e ).
33+ SetPathParam (("blueprint" ), e .Blueprint ).
3234 SetQueryParam ("upsert" , "true" ).
3335 SetResult (& pb ).
3436 Post (url )
@@ -41,11 +43,12 @@ func (c *PortClient) CreateEntity(ctx context.Context, e *Entity) (*Entity, erro
4143 return & pb .Entity , nil
4244}
4345
44- func (c * PortClient ) DeleteEntity (ctx context.Context , id string ) error {
45- url := "v0.1 /entities/{identifier}"
46+ func (c * PortClient ) DeleteEntity (ctx context.Context , id string , blueprint string ) error {
47+ url := "v1/blueprints/{blueprint} /entities/{identifier}"
4648 pb := & PortBody {}
4749 resp , err := c .Client .R ().
4850 SetHeader ("Accept" , "application/json" ).
51+ SetPathParam ("blueprint" , blueprint ).
4952 SetPathParam ("identifier" , id ).
5053 SetResult (pb ).
5154 Delete (url )
0 commit comments