# Hostnames ## List Web3 Hostnames `client.Web3.Hostnames.List(ctx, query) (*SinglePage[Hostname], error)` **get** `/zones/{zone_id}/web3/hostnames` List Web3 Hostnames ### Parameters - `query HostnameListParams` - `ZoneID param.Field[string]` Specify the identifier of the hostname. ### Returns - `type Hostname struct{…}` - `ID string` Specify the identifier of the hostname. - `CreatedOn Time` - `Description string` Specify an optional description of the hostname. - `Dnslink string` Specify the DNSLink value used if the target is ipfs. - `ModifiedOn Time` - `Name string` Specify the hostname that points to the target gateway via CNAME. - `Status HostnameStatus` Specifies the status of the hostname's activation. - `const HostnameStatusActive HostnameStatus = "active"` - `const HostnameStatusPending HostnameStatus = "pending"` - `const HostnameStatusDeleting HostnameStatus = "deleting"` - `const HostnameStatusError HostnameStatus = "error"` - `Target HostnameTarget` Specify the target gateway of the hostname. - `const HostnameTargetEthereum HostnameTarget = "ethereum"` - `const HostnameTargetIPFS HostnameTarget = "ipfs"` - `const HostnameTargetIPFSUniversalPath HostnameTarget = "ipfs_universal_path"` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/web3" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) page, err := client.Web3.Hostnames.List(context.TODO(), web3.HostnameListParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", page) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": [ { "id": "023e105f4ecef8ad9ca31a8372d0c353", "created_on": "2014-01-01T05:20:00.12345Z", "description": "This is my IPFS gateway.", "dnslink": "/ipns/onboarding.ipfs.cloudflare.com", "modified_on": "2014-01-01T05:20:00.12345Z", "name": "gateway.example.com", "status": "active", "target": "ipfs" } ], "success": true, "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000 } } ``` ## Web3 Hostname Details `client.Web3.Hostnames.Get(ctx, identifier, query) (*Hostname, error)` **get** `/zones/{zone_id}/web3/hostnames/{identifier}` Web3 Hostname Details ### Parameters - `identifier string` Specify the identifier of the hostname. - `query HostnameGetParams` - `ZoneID param.Field[string]` Specify the identifier of the hostname. ### Returns - `type Hostname struct{…}` - `ID string` Specify the identifier of the hostname. - `CreatedOn Time` - `Description string` Specify an optional description of the hostname. - `Dnslink string` Specify the DNSLink value used if the target is ipfs. - `ModifiedOn Time` - `Name string` Specify the hostname that points to the target gateway via CNAME. - `Status HostnameStatus` Specifies the status of the hostname's activation. - `const HostnameStatusActive HostnameStatus = "active"` - `const HostnameStatusPending HostnameStatus = "pending"` - `const HostnameStatusDeleting HostnameStatus = "deleting"` - `const HostnameStatusError HostnameStatus = "error"` - `Target HostnameTarget` Specify the target gateway of the hostname. - `const HostnameTargetEthereum HostnameTarget = "ethereum"` - `const HostnameTargetIPFS HostnameTarget = "ipfs"` - `const HostnameTargetIPFSUniversalPath HostnameTarget = "ipfs_universal_path"` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/web3" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) hostname, err := client.Web3.Hostnames.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", web3.HostnameGetParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", hostname.ID) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "id": "023e105f4ecef8ad9ca31a8372d0c353", "created_on": "2014-01-01T05:20:00.12345Z", "description": "This is my IPFS gateway.", "dnslink": "/ipns/onboarding.ipfs.cloudflare.com", "modified_on": "2014-01-01T05:20:00.12345Z", "name": "gateway.example.com", "status": "active", "target": "ipfs" }, "success": true, "result_info": {} } ``` ## Create Web3 Hostname `client.Web3.Hostnames.New(ctx, params) (*Hostname, error)` **post** `/zones/{zone_id}/web3/hostnames` Create Web3 Hostname ### Parameters - `params HostnameNewParams` - `ZoneID param.Field[string]` Path param: Specify the identifier of the hostname. - `Name param.Field[string]` Body param: Specify the hostname that points to the target gateway via CNAME. - `Target param.Field[HostnameNewParamsTarget]` Body param: Specify the target gateway of the hostname. - `const HostnameNewParamsTargetEthereum HostnameNewParamsTarget = "ethereum"` - `const HostnameNewParamsTargetIPFS HostnameNewParamsTarget = "ipfs"` - `const HostnameNewParamsTargetIPFSUniversalPath HostnameNewParamsTarget = "ipfs_universal_path"` - `Description param.Field[string]` Body param: Specify an optional description of the hostname. - `Dnslink param.Field[string]` Body param: Specify the DNSLink value used if the target is ipfs. ### Returns - `type Hostname struct{…}` - `ID string` Specify the identifier of the hostname. - `CreatedOn Time` - `Description string` Specify an optional description of the hostname. - `Dnslink string` Specify the DNSLink value used if the target is ipfs. - `ModifiedOn Time` - `Name string` Specify the hostname that points to the target gateway via CNAME. - `Status HostnameStatus` Specifies the status of the hostname's activation. - `const HostnameStatusActive HostnameStatus = "active"` - `const HostnameStatusPending HostnameStatus = "pending"` - `const HostnameStatusDeleting HostnameStatus = "deleting"` - `const HostnameStatusError HostnameStatus = "error"` - `Target HostnameTarget` Specify the target gateway of the hostname. - `const HostnameTargetEthereum HostnameTarget = "ethereum"` - `const HostnameTargetIPFS HostnameTarget = "ipfs"` - `const HostnameTargetIPFSUniversalPath HostnameTarget = "ipfs_universal_path"` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/web3" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) hostname, err := client.Web3.Hostnames.New(context.TODO(), web3.HostnameNewParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), Name: cloudflare.F("gateway.example.com"), Target: cloudflare.F(web3.HostnameNewParamsTargetIPFS), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", hostname.ID) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "id": "023e105f4ecef8ad9ca31a8372d0c353", "created_on": "2014-01-01T05:20:00.12345Z", "description": "This is my IPFS gateway.", "dnslink": "/ipns/onboarding.ipfs.cloudflare.com", "modified_on": "2014-01-01T05:20:00.12345Z", "name": "gateway.example.com", "status": "active", "target": "ipfs" }, "success": true, "result_info": {} } ``` ## Edit Web3 Hostname `client.Web3.Hostnames.Edit(ctx, identifier, params) (*Hostname, error)` **patch** `/zones/{zone_id}/web3/hostnames/{identifier}` Edit Web3 Hostname ### Parameters - `identifier string` Specify the identifier of the hostname. - `params HostnameEditParams` - `ZoneID param.Field[string]` Path param: Specify the identifier of the hostname. - `Description param.Field[string]` Body param: Specify an optional description of the hostname. - `Dnslink param.Field[string]` Body param: Specify the DNSLink value used if the target is ipfs. ### Returns - `type Hostname struct{…}` - `ID string` Specify the identifier of the hostname. - `CreatedOn Time` - `Description string` Specify an optional description of the hostname. - `Dnslink string` Specify the DNSLink value used if the target is ipfs. - `ModifiedOn Time` - `Name string` Specify the hostname that points to the target gateway via CNAME. - `Status HostnameStatus` Specifies the status of the hostname's activation. - `const HostnameStatusActive HostnameStatus = "active"` - `const HostnameStatusPending HostnameStatus = "pending"` - `const HostnameStatusDeleting HostnameStatus = "deleting"` - `const HostnameStatusError HostnameStatus = "error"` - `Target HostnameTarget` Specify the target gateway of the hostname. - `const HostnameTargetEthereum HostnameTarget = "ethereum"` - `const HostnameTargetIPFS HostnameTarget = "ipfs"` - `const HostnameTargetIPFSUniversalPath HostnameTarget = "ipfs_universal_path"` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/web3" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) hostname, err := client.Web3.Hostnames.Edit( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", web3.HostnameEditParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", hostname.ID) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "id": "023e105f4ecef8ad9ca31a8372d0c353", "created_on": "2014-01-01T05:20:00.12345Z", "description": "This is my IPFS gateway.", "dnslink": "/ipns/onboarding.ipfs.cloudflare.com", "modified_on": "2014-01-01T05:20:00.12345Z", "name": "gateway.example.com", "status": "active", "target": "ipfs" }, "success": true, "result_info": {} } ``` ## Delete Web3 Hostname `client.Web3.Hostnames.Delete(ctx, identifier, body) (*HostnameDeleteResponse, error)` **delete** `/zones/{zone_id}/web3/hostnames/{identifier}` Delete Web3 Hostname ### Parameters - `identifier string` Specify the identifier of the hostname. - `body HostnameDeleteParams` - `ZoneID param.Field[string]` Specify the identifier of the hostname. ### Returns - `type HostnameDeleteResponse struct{…}` - `ID string` Specify the identifier of the hostname. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/web3" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) hostname, err := client.Web3.Hostnames.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", web3.HostnameDeleteParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", hostname.ID) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "id": "023e105f4ecef8ad9ca31a8372d0c353" }, "success": true } ``` ## Domain Types ### Hostname - `type Hostname struct{…}` - `ID string` Specify the identifier of the hostname. - `CreatedOn Time` - `Description string` Specify an optional description of the hostname. - `Dnslink string` Specify the DNSLink value used if the target is ipfs. - `ModifiedOn Time` - `Name string` Specify the hostname that points to the target gateway via CNAME. - `Status HostnameStatus` Specifies the status of the hostname's activation. - `const HostnameStatusActive HostnameStatus = "active"` - `const HostnameStatusPending HostnameStatus = "pending"` - `const HostnameStatusDeleting HostnameStatus = "deleting"` - `const HostnameStatusError HostnameStatus = "error"` - `Target HostnameTarget` Specify the target gateway of the hostname. - `const HostnameTargetEthereum HostnameTarget = "ethereum"` - `const HostnameTargetIPFS HostnameTarget = "ipfs"` - `const HostnameTargetIPFSUniversalPath HostnameTarget = "ipfs_universal_path"` # IPFS Universal Paths # Content Lists ## IPFS Universal Path Gateway Content List Details `client.Web3.Hostnames.IPFSUniversalPaths.ContentLists.Get(ctx, identifier, query) (*ContentList, error)` **get** `/zones/{zone_id}/web3/hostnames/{identifier}/ipfs_universal_path/content_list` IPFS Universal Path Gateway Content List Details ### Parameters - `identifier string` Specify the identifier of the hostname. - `query HostnameIPFSUniversalPathContentListGetParams` - `ZoneID param.Field[string]` Specify the identifier of the hostname. ### Returns - `type ContentList struct{…}` - `Action ContentListAction` Behavior of the content list. - `const ContentListActionBlock ContentListAction = "block"` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/web3" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) contentList, err := client.Web3.Hostnames.IPFSUniversalPaths.ContentLists.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", web3.HostnameIPFSUniversalPathContentListGetParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", contentList.Action) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "action": "block" }, "success": true, "result_info": {} } ``` ## Update IPFS Universal Path Gateway Content List `client.Web3.Hostnames.IPFSUniversalPaths.ContentLists.Update(ctx, identifier, params) (*ContentList, error)` **put** `/zones/{zone_id}/web3/hostnames/{identifier}/ipfs_universal_path/content_list` Update IPFS Universal Path Gateway Content List ### Parameters - `identifier string` Specify the identifier of the hostname. - `params HostnameIPFSUniversalPathContentListUpdateParams` - `ZoneID param.Field[string]` Path param: Specify the identifier of the hostname. - `Action param.Field[HostnameIPFSUniversalPathContentListUpdateParamsAction]` Body param: Behavior of the content list. - `const HostnameIPFSUniversalPathContentListUpdateParamsActionBlock HostnameIPFSUniversalPathContentListUpdateParamsAction = "block"` - `Entries param.Field[[]HostnameIPFSUniversalPathContentListUpdateParamsEntry]` Body param: Provides content list entries. - `ID string` Specify the identifier of the hostname. - `Content string` Specify the CID or content path of content to block. - `CreatedOn Time` - `Description string` Specify an optional description of the content list entry. - `ModifiedOn Time` - `Type HostnameIPFSUniversalPathContentListUpdateParamsEntriesType` Specify the type of content list entry to block. - `const HostnameIPFSUniversalPathContentListUpdateParamsEntriesTypeCid HostnameIPFSUniversalPathContentListUpdateParamsEntriesType = "cid"` - `const HostnameIPFSUniversalPathContentListUpdateParamsEntriesTypeContentPath HostnameIPFSUniversalPathContentListUpdateParamsEntriesType = "content_path"` ### Returns - `type ContentList struct{…}` - `Action ContentListAction` Behavior of the content list. - `const ContentListActionBlock ContentListAction = "block"` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/web3" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) contentList, err := client.Web3.Hostnames.IPFSUniversalPaths.ContentLists.Update( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", web3.HostnameIPFSUniversalPathContentListUpdateParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), Action: cloudflare.F(web3.HostnameIPFSUniversalPathContentListUpdateParamsActionBlock), Entries: cloudflare.F([]web3.HostnameIPFSUniversalPathContentListUpdateParamsEntry{web3.HostnameIPFSUniversalPathContentListUpdateParamsEntry{ }}), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", contentList.Action) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "action": "block" }, "success": true, "result_info": {} } ``` ## Domain Types ### Content List - `type ContentList struct{…}` - `Action ContentListAction` Behavior of the content list. - `const ContentListActionBlock ContentListAction = "block"` # Entries ## List IPFS Universal Path Gateway Content List Entries `client.Web3.Hostnames.IPFSUniversalPaths.ContentLists.Entries.List(ctx, identifier, query) (*HostnameIPFSUniversalPathContentListEntryListResponse, error)` **get** `/zones/{zone_id}/web3/hostnames/{identifier}/ipfs_universal_path/content_list/entries` List IPFS Universal Path Gateway Content List Entries ### Parameters - `identifier string` Specify the identifier of the hostname. - `query HostnameIPFSUniversalPathContentListEntryListParams` - `ZoneID param.Field[string]` Specify the identifier of the hostname. ### Returns - `type HostnameIPFSUniversalPathContentListEntryListResponse struct{…}` - `Entries []HostnameIPFSUniversalPathContentListEntryListResponseEntry` Provides content list entries. - `ID string` Specify the identifier of the hostname. - `Content string` Specify the CID or content path of content to block. - `CreatedOn Time` - `Description string` Specify an optional description of the content list entry. - `ModifiedOn Time` - `Type HostnameIPFSUniversalPathContentListEntryListResponseEntriesType` Specify the type of content list entry to block. - `const HostnameIPFSUniversalPathContentListEntryListResponseEntriesTypeCid HostnameIPFSUniversalPathContentListEntryListResponseEntriesType = "cid"` - `const HostnameIPFSUniversalPathContentListEntryListResponseEntriesTypeContentPath HostnameIPFSUniversalPathContentListEntryListResponseEntriesType = "content_path"` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/web3" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) entries, err := client.Web3.Hostnames.IPFSUniversalPaths.ContentLists.Entries.List( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", web3.HostnameIPFSUniversalPathContentListEntryListParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", entries.Entries) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "entries": [ { "id": "023e105f4ecef8ad9ca31a8372d0c353", "content": "QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB", "created_on": "2014-01-01T05:20:00.12345Z", "description": "this is my content list entry", "modified_on": "2014-01-01T05:20:00.12345Z", "type": "cid" } ] }, "success": true, "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000 } } ``` ## IPFS Universal Path Gateway Content List Entry Details `client.Web3.Hostnames.IPFSUniversalPaths.ContentLists.Entries.Get(ctx, identifier, contentListEntryIdentifier, query) (*HostnameIPFSUniversalPathContentListEntryGetResponse, error)` **get** `/zones/{zone_id}/web3/hostnames/{identifier}/ipfs_universal_path/content_list/entries/{content_list_entry_identifier}` IPFS Universal Path Gateway Content List Entry Details ### Parameters - `identifier string` Specify the identifier of the hostname. - `contentListEntryIdentifier string` Specify the identifier of the hostname. - `query HostnameIPFSUniversalPathContentListEntryGetParams` - `ZoneID param.Field[string]` Specify the identifier of the hostname. ### Returns - `type HostnameIPFSUniversalPathContentListEntryGetResponse struct{…}` Specify a content list entry to block. - `ID string` Specify the identifier of the hostname. - `Content string` Specify the CID or content path of content to block. - `CreatedOn Time` - `Description string` Specify an optional description of the content list entry. - `ModifiedOn Time` - `Type HostnameIPFSUniversalPathContentListEntryGetResponseType` Specify the type of content list entry to block. - `const HostnameIPFSUniversalPathContentListEntryGetResponseTypeCid HostnameIPFSUniversalPathContentListEntryGetResponseType = "cid"` - `const HostnameIPFSUniversalPathContentListEntryGetResponseTypeContentPath HostnameIPFSUniversalPathContentListEntryGetResponseType = "content_path"` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/web3" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) entry, err := client.Web3.Hostnames.IPFSUniversalPaths.ContentLists.Entries.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "023e105f4ecef8ad9ca31a8372d0c353", web3.HostnameIPFSUniversalPathContentListEntryGetParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", entry.ID) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "id": "023e105f4ecef8ad9ca31a8372d0c353", "content": "QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB", "created_on": "2014-01-01T05:20:00.12345Z", "description": "this is my content list entry", "modified_on": "2014-01-01T05:20:00.12345Z", "type": "cid" }, "success": true, "result_info": {} } ``` ## Create IPFS Universal Path Gateway Content List Entry `client.Web3.Hostnames.IPFSUniversalPaths.ContentLists.Entries.New(ctx, identifier, params) (*HostnameIPFSUniversalPathContentListEntryNewResponse, error)` **post** `/zones/{zone_id}/web3/hostnames/{identifier}/ipfs_universal_path/content_list/entries` Create IPFS Universal Path Gateway Content List Entry ### Parameters - `identifier string` Specify the identifier of the hostname. - `params HostnameIPFSUniversalPathContentListEntryNewParams` - `ZoneID param.Field[string]` Path param: Specify the identifier of the hostname. - `Content param.Field[string]` Body param: Specify the CID or content path of content to block. - `Type param.Field[HostnameIPFSUniversalPathContentListEntryNewParamsType]` Body param: Specify the type of content list entry to block. - `const HostnameIPFSUniversalPathContentListEntryNewParamsTypeCid HostnameIPFSUniversalPathContentListEntryNewParamsType = "cid"` - `const HostnameIPFSUniversalPathContentListEntryNewParamsTypeContentPath HostnameIPFSUniversalPathContentListEntryNewParamsType = "content_path"` - `Description param.Field[string]` Body param: Specify an optional description of the content list entry. ### Returns - `type HostnameIPFSUniversalPathContentListEntryNewResponse struct{…}` Specify a content list entry to block. - `ID string` Specify the identifier of the hostname. - `Content string` Specify the CID or content path of content to block. - `CreatedOn Time` - `Description string` Specify an optional description of the content list entry. - `ModifiedOn Time` - `Type HostnameIPFSUniversalPathContentListEntryNewResponseType` Specify the type of content list entry to block. - `const HostnameIPFSUniversalPathContentListEntryNewResponseTypeCid HostnameIPFSUniversalPathContentListEntryNewResponseType = "cid"` - `const HostnameIPFSUniversalPathContentListEntryNewResponseTypeContentPath HostnameIPFSUniversalPathContentListEntryNewResponseType = "content_path"` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/web3" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) entry, err := client.Web3.Hostnames.IPFSUniversalPaths.ContentLists.Entries.New( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", web3.HostnameIPFSUniversalPathContentListEntryNewParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), Content: cloudflare.F("QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB"), Type: cloudflare.F(web3.HostnameIPFSUniversalPathContentListEntryNewParamsTypeCid), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", entry.ID) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "id": "023e105f4ecef8ad9ca31a8372d0c353", "content": "QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB", "created_on": "2014-01-01T05:20:00.12345Z", "description": "this is my content list entry", "modified_on": "2014-01-01T05:20:00.12345Z", "type": "cid" }, "success": true, "result_info": {} } ``` ## Edit IPFS Universal Path Gateway Content List Entry `client.Web3.Hostnames.IPFSUniversalPaths.ContentLists.Entries.Update(ctx, identifier, contentListEntryIdentifier, params) (*HostnameIPFSUniversalPathContentListEntryUpdateResponse, error)` **put** `/zones/{zone_id}/web3/hostnames/{identifier}/ipfs_universal_path/content_list/entries/{content_list_entry_identifier}` Edit IPFS Universal Path Gateway Content List Entry ### Parameters - `identifier string` Specify the identifier of the hostname. - `contentListEntryIdentifier string` Specify the identifier of the hostname. - `params HostnameIPFSUniversalPathContentListEntryUpdateParams` - `ZoneID param.Field[string]` Path param: Specify the identifier of the hostname. - `Content param.Field[string]` Body param: Specify the CID or content path of content to block. - `Type param.Field[HostnameIPFSUniversalPathContentListEntryUpdateParamsType]` Body param: Specify the type of content list entry to block. - `const HostnameIPFSUniversalPathContentListEntryUpdateParamsTypeCid HostnameIPFSUniversalPathContentListEntryUpdateParamsType = "cid"` - `const HostnameIPFSUniversalPathContentListEntryUpdateParamsTypeContentPath HostnameIPFSUniversalPathContentListEntryUpdateParamsType = "content_path"` - `Description param.Field[string]` Body param: Specify an optional description of the content list entry. ### Returns - `type HostnameIPFSUniversalPathContentListEntryUpdateResponse struct{…}` Specify a content list entry to block. - `ID string` Specify the identifier of the hostname. - `Content string` Specify the CID or content path of content to block. - `CreatedOn Time` - `Description string` Specify an optional description of the content list entry. - `ModifiedOn Time` - `Type HostnameIPFSUniversalPathContentListEntryUpdateResponseType` Specify the type of content list entry to block. - `const HostnameIPFSUniversalPathContentListEntryUpdateResponseTypeCid HostnameIPFSUniversalPathContentListEntryUpdateResponseType = "cid"` - `const HostnameIPFSUniversalPathContentListEntryUpdateResponseTypeContentPath HostnameIPFSUniversalPathContentListEntryUpdateResponseType = "content_path"` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/web3" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) entry, err := client.Web3.Hostnames.IPFSUniversalPaths.ContentLists.Entries.Update( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "023e105f4ecef8ad9ca31a8372d0c353", web3.HostnameIPFSUniversalPathContentListEntryUpdateParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), Content: cloudflare.F("QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB"), Type: cloudflare.F(web3.HostnameIPFSUniversalPathContentListEntryUpdateParamsTypeCid), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", entry.ID) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "id": "023e105f4ecef8ad9ca31a8372d0c353", "content": "QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB", "created_on": "2014-01-01T05:20:00.12345Z", "description": "this is my content list entry", "modified_on": "2014-01-01T05:20:00.12345Z", "type": "cid" }, "success": true, "result_info": {} } ``` ## Delete IPFS Universal Path Gateway Content List Entry `client.Web3.Hostnames.IPFSUniversalPaths.ContentLists.Entries.Delete(ctx, identifier, contentListEntryIdentifier, body) (*HostnameIPFSUniversalPathContentListEntryDeleteResponse, error)` **delete** `/zones/{zone_id}/web3/hostnames/{identifier}/ipfs_universal_path/content_list/entries/{content_list_entry_identifier}` Delete IPFS Universal Path Gateway Content List Entry ### Parameters - `identifier string` Specify the identifier of the hostname. - `contentListEntryIdentifier string` Specify the identifier of the hostname. - `body HostnameIPFSUniversalPathContentListEntryDeleteParams` - `ZoneID param.Field[string]` Specify the identifier of the hostname. ### Returns - `type HostnameIPFSUniversalPathContentListEntryDeleteResponse struct{…}` - `ID string` Specify the identifier of the hostname. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/web3" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) entry, err := client.Web3.Hostnames.IPFSUniversalPaths.ContentLists.Entries.Delete( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "023e105f4ecef8ad9ca31a8372d0c353", web3.HostnameIPFSUniversalPathContentListEntryDeleteParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", entry.ID) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "id": "023e105f4ecef8ad9ca31a8372d0c353" }, "success": true } ```